Find duplicates in data table, calculate value

Assumption: Col Structure: ID; Value; Date

Assign Activity:
dtResult = dtorig.Clone

Assign Activity:
dtResult =

(From d in dtOrig.AsEnumerable
Group d by k=d("ID").toString.Trim into grp=Group
Let sm = grp.Sum(Function (x) CInt(x("Value").toString.Trim))
Let ra = new Object(){k,sm, grp.First()(2)}
Select r = dtResult.Rows.Add(ra)).CopyToDataTable

Kindly note:

  • As date can also occur within a group with different values. The implementation is here coded in order to to take the first groupmember row and its date

there are several strategies in how to construct the itemarray and depends on the details of the col structure to take best minimal effort fitting approach

No problem, on the begin of the howto also a NON-Linq approach is described