How do I combine multiple columns to group by? This is where I am getting wrong. Group d By k={d("Product ID").toString.Trim, d("Product NAme").toString.Trim} Into grp=Group
prepare a target datatable by
dtTarget = yourOriginDataTableVar.Clone
then try following LINQ
(From d in yourOriginDataTableVar.AsEnumerable
Group d by k1=d("Product ID").toString.Trim, k2=d("Product Name").toString.Trim Into grp=Group
let cm = String.Join(",", grp.Select(Function (x) x("Component"))
let cmi = String.Join(",", grp.Select(Function (x) x("Component ID"))
let cma = String.Join(",", grp.Select(Function (x) x("Component Available"))
let ra = new Object(){k1,k2,cm,cmi,cma}
Select dtTarget.Rows.Add(ra)).CopyToDataTable