How to Sum all the values in multiple column index using LINQ

Hi,

If you need sum value of specific column, the following help you.

dt.AsEnumerable.Take(dt.Rows.Count-1).Sum(Function(r) Double.Parse(r(4).ToString))

The above returns sum value of 4th column of the datatable (0-base index)

Regards,

2 Likes