![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
Can you clarify the question? I'm not 100% sure I have followed it... However, looking forward a few weeks, LINQ supports this via Distinct() [which can accept a comparer], and .NET 3.5 ships with LINQ extensions for DataTable etc. I may not have fully followed the question, though. Marc |
#4
| |||
| |||
|
#5
| |||
| |||
|
|
With LINQ (.NET 3.5, C# 3), yes: var distinctNames = ( from row in untypedDataTable.AsEnumerable() select row.Field<string>("Name")).Distinct(); foreach (var name in query) { Console.WriteLine(name); } alternatively, if typed: var distinctNames = ( from row in typedDataTable select row.Name).Distinct(); Marc |
#6
| |||
| |||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |