I have excel data, and read all data and stored into datatable.
Now, I need to group the one column and according to new data, I want to store into list.
THis the screen shot, And I need to group the Location column.
For this, I’m trying to use Linq group by.
List=dt.AsEnumerable().Groupby(function(r) r.Field(Of String)(“Location”).Where(function(g) g.count()>1).toList()
Create variable as List <List=New List(Of String)List=(From d in dtData.AsEnumerable
Group d by k=d(“Location”).toString.Trim into grp=Group
Where grp.Count > 1
Select grp.ToList).ToList
But IT showing error