How to sum the column values using LINQ

Hi,

For now, can you try the following? This wlll calculate from A to J in the above sheet.

dtResult = dt.AsEnumerable.GroupBy(Function(r) r("Number").ToString).Select(Function(g) dtResult.LoadDataRow({g.key,g.Sum(Function(r) r.ItemArray.Skip(3).Take(10).Sum(Function(o) Double.Parse(o.ToString,System.Globalization.CultureInfo.CreateSpecificCulture("Es-es")))   ).ToString(System.Globalization.CultureInfo.CreateSpecificCulture("ES-es")) },False)).CopyToDataTable
1 Like