Hi All,
I’m currently using this expression to sum a datatable column by a grouping (Total by Currency) before assigning the list to another datatable using a for each row loop:
ListA = (From p In dta.Select()
Group p By ID=p.Item(“Currency”).ToString Into GroupA=Group
Select.Covert.ToString(GroupA.Sum(Function(x) Convert.ToDouble(x.Item(“Total”).ToString)))).ToList()
Now, this works OK, except when it sums to a zero, where I get that odd numerical representation of zero we sometimes see in Excel (eg 1.16415321826935E-10) - this causes me problems later on in the my process.
So, I’m trying to execute a version of the above code but using Convert.ToDecimal instead of Convert.ToDouble, but it is throwing me an error:
Expression of type ‘1-dimensional array of System.Data.DataRow’ is not queryable.
Any ideas?
Thanks in advance
Paul