Hi
I have a scenario my input Datatable is as below
| Ram | Good |
|---|---|
| Shyam | Nice |
| Bheem | Marvelous |
| Bheem | Good |
Output datatable is:
| Ram | Good |
|---|---|
| Shyam | Nice |
| Bheem | |
| Bheem | Marvelpous,Good |
Hi
I have a scenario my input Datatable is as below
| Ram | Good |
|---|---|
| Shyam | Nice |
| Bheem | Marvelous |
| Bheem | Good |
Output datatable is:
| Ram | Good |
|---|---|
| Shyam | Nice |
| Bheem | |
| Bheem | Marvelpous,Good |
Try this
(From row In DT.AsEnumerable()
Group row By Key = row.ItemArray(0) Into Group
Let Status = If(Group.Count() > 1, String.Join(",", Group.Select(Function(r) r.ItemArray(1))), If(Group.Count() = 1, Group.First().ItemArray(1).ToString(), ""))
Select DT.Clone.Rows.Add(Key, Status)).CopyToDataTable()
Cheers!!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.