I've been tasked to take over some legacy reporting written in Visual Basic and have been tasked with updating some of the reports which the only way I can see is to use LINQ which I'm having a heck of a time with and I've spent the past week on Google trying to sort it out but I'm just missing "something".
What I have is a datatable that has like 10 columns and I need to group on two taking the results of the grouping and placing it into another datatable.
What I have so far is...
Dim Rep_Country_DataTable As New System.Data.DataTable
Dim Rep_Country_Group As IEnumerable = From Data_Row In Export_DataTable.Select("REP IS NOT NULL").AsEnumerable
Group Data_Row By Rep = Data_Row.Field(Of String)("REP"),
Country = Data_Row.Field(Of String)("COUNTRY") Into Group
Select Rep, Country
The LINQ works and I can see the grouped data in "Rep_Country_Group". My problem now is getting that data into the "Rep_Country_Group_DataTable" datatable, that's the part I can't figure out.
I would appreciate any help with this as I know it's something simple I'm missing.