8

I would like to implement a "Group By" for my datatable. Has any one any suggestions?

update:

c#, .net 2.0

1

2 Answers 2

10

You can use the linq extensions in the System.Data.DataSetExtensions assembly:

DataTable t = // var groups = t.AsEnumerable() .GroupBy(r => r.Field<T>("columnName")) 
Sign up to request clarification or add additional context in comments.

Comments

0

Use LINQ to DataSets and the GroupBy extension methods.

Add assembly System.Data.DataSetExtensions.dll to your project to get access to the AsEnumerable() extension method.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.