@brindhaS
Assign: left Side new Var DataTable: dtResult, right side: OriginalDataTableVar.Clone
Assign:
left side: dtresult
right side:
(From d in OriginalDataTableVar.AsEnumerable
Group d by k=d(0).toString.Trim Into grp=Group
let res = grp.Sum(Function (r) Cint(r(1).toString.Trim))
Select dtResult.Rows.Add({k,res})).CopyToDataTable
That works friend thanks but it taking only that two columns I having totally 6 columns along with it.what to do for it any change in that code u given also it roundup the value point value
@ppr
There are more columns in my dt not only this two columns
ID Name data Details Amount
12 Apple. Data’s. Details 50
34. Nokia. Data. Details. 50
45. Vivo. Good. Details. 30
I want to get like this .please tell me any minor change in the code you have given
@brindhaS
Doing all in a LINQ and bring this dynamics in it (Statics, Aggregations) will result in less maintainable solution.
Find a demo balancing this both. As in a first go all statics are assigned, then only Assignments for the Custom Aggregations is needed. (Think on 25 Cols, 23 static)
I adopted for you to do the sums on doubles and schow cased on String Aggregations as well