I wanted to combine the rows into one single row if it has different value in it’s value I want to merge that.
I used on query but resulted into two rows(when it has more column)
Can anyone help me to merge it into one single row based on id.
@ashokkarale, I tried this solution, this will merge rows but when we have more columns this will result in two rows with merged values. Is there any other way to do this.
(From d in dtOrigVar.AsEnumerable
Group d by k1=d("id").toString.Trim, k2=d("name").toString.Trim into grp=Group
let ra1 = grp.First().ItemArray.SkipLast(1).Cast(of Object)
Let tj = String.Join(",", grp.Select(Function (g) g("tokenName"))
Let ra = ra1.Append(tj).toArray
Select r = dtResult.Rows.Add(ra)).CopyToDataTable