-2

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.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
suhaas
  • 3
  • 3
  • 1
    Welcome to SO - please read https://stackoverflow.com/help/how-to-ask and https://codeblog.jonskeet.uk/2010/08/29/writing-the-perfect-question/ – riffnl Nov 24 '22 at 11:37

1 Answers1

0

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().

Tim Maes
  • 473
  • 3
  • 15
  • I would do a int.TryParse(stringValue, out value) since you can't just cast string to int https://stackoverflow.com/questions/17785351/input-string-was-not-in-a-correct-format-converting-string-to-int – Tim Maes Nov 24 '22 at 13:48