(From d In outDt.AsEnumerable
Group d By k=d(“A”).toString.Trim, k1=d(“B”).toString.Trim, k2=d(“C”).toString.Trim Into grp=Group
Let n = String.Join(“,”,grp.Select(Function (x) x(“old”).toString.Trim).toArray)
Let f = String.Join(“,”,grp.Select(Function (x) x(“New”).toString.Trim).toArray)
Let ra = New Object(){k,k1,k2,n,f}
Select dtReport.Rows.Add(ra)).CopyToDataTable
It works, the problem is: if i’ve some other columns to display in the new DT, how do I insert them into the new object?
If my assumption is right, you would want to add also other columns which are already available in the Original DT, then you could add the column values using the row object d that you have created.
Let ra = New Object(){k,k1,k2,n,f,d("YourRequiredColumn").ToString}
But the Output Datatable dtReport also need to have the number of Columns available to include this value.