Hi,
I’m trying to get the sum of a column and I used the query dt_Input.AsEnumerable.Sum(Function(x) Convert.ToDouble(x(“Total”).ToString.Trim)).ToString
I get “Input string was not in a correct format.” error. Can anyone help me out?

Thanks
Hi,
I’m trying to get the sum of a column and I used the query dt_Input.AsEnumerable.Sum(Function(x) Convert.ToDouble(x(“Total”).ToString.Trim)).ToString
I get “Input string was not in a correct format.” error. Can anyone help me out?

Thanks
Fine
do we have any - symbol or any space between numbers or any comma between numbers
kindly validate that once pls
Cheers @VanithaRajakumar
Hi… I have attached the input screenshot above. Its the same. There is no space or character in the numbers
Hello @VanithaRajakumar
use this code
DT.AsEnumerable.Sum(Function(r) If(IsNumeric(r("ColumnName").ToString.Trim), CDbl(r("ColumnName").ToString.Trim), 0) )
@vickydas. Thanks a lot. It worked ![]()
Hi ,
To sum the DataTable column , you use this activity.
Regards
Balamurugan.S
Thank you all for the quick response…!! Vickydas’s solution worked for me.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.