Using LINQ for Grouping RRS feed

  • Question

  • Hi,

    I have a datatable with two columns, colCity and colCountry. I want to use LINQ to filter only those rows for which more than one city of that country is listed. After getting the results, i need to push them into another table with similar structure (something like SELECT INTO). What's the best way of doing it? I tried Group By clause with Group.Count() > 1, but then the output only shows the Group level columns and not the actual child rows. MSDN says that Group By will create a "List of lists" on which we need to run a nested For-Each. Is there something better?

    Thanks in advance.

    Tuesday, December 16, 2008 2:30 PM