Search code examples
c#datatable

Sum of row data in datatable with double quotes


I want get the total of a column in a datatable which has rows with double quotes.

datatable image

I want to add both rows in LINES_DISPENSED_AMOUNT1 column.


Solution

  • Since this has C# tag, I would suggest you fetch all records, then in C# loop over the values and do a value.Trim('"'). Parse values to int and do a LINQ query sum().