Giminera,
Do you know the method to add columns to your datatable while using
expressions and to vertical sum while using compute.
http://msdn2.microsoft.com/en-gb/lib...e.compute.aspx
http://msdn2.microsoft.com/en-gb/library/system.data.datacolumn.expression(VS.80).aspx
As long as you don't force it, will those columns not come in your database.
Cor
"giminera" <(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed)...
> I've got a dataset on a datagridview: fileds are
> code,descr,price,vatcode. I have to calculate the total amount of
> vat.
> Example:
> first row = price 10$, vatcode 20
> second row = price 50$, vatcode 10
> third row = price 10$, vatcode 20
> So, I have a SQL Table with vatcode and vat%, for example vatcode 20 =
> 20%, vatcode 10 = 10%
> The goal is to group the rows of dataset (datagridview) by the vatcode
> and calculate the total price for every different vatcode, for
> example:
> amount of 20$ (sum of first and third rows) with vatcode 20.
> amount of 50 with vatcode 10 (the only one in the datagrid with that
> vatcode).
> After I have to calculate the entire amount of vat, so I have 20$ at
> 20% and 50$ at 10% and put it into a variable.
> Thanks.
> George
>