Not sure to why I am getting this error with this statement.
Have a look if any value form the column which is used for the sum is null, empty or has a invalid format e.g 1.212,45
You can also try following
dtData.AsEnumerable.Sum(Function (a) Convert.ToDouble(“0” & a(“Total Amount”).toString.Trim)
Had you also checked for empty, " ", Null or invalid format values for this column values?
Yeah all the values are valid
how did you checked?
Values are valid
logging can hide some details
in your case:
dtData.AsEnumerable.Where(Function (x) Not Double.TryParse(x(“Total Amount”).toString.Trim, nothing)).ToList
After the LINQ expression put .Tostring
It is saying incorrect incorrect string. It means you need print this value as a string