Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select to a temporary cursor
Message
From
17/12/2008 23:05:57
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01365559
Message ID:
01368391
Views:
9
>This looks like it would do exactly what I need. Thanks so much.

Great! You're welcome! =0)

~~Bonnie



>>Hi Linda,
>>
>>As far as I know, using the .ToTable() method of a DataView is the only easy way to get a DataTable of unique values. You'd need to use this syntax:
>>
>>
>>DataTable dtUniqueCities = MyDataSet.Tables["Customers"].DefaultView.ToTable(true, "City"); 
>>
>>
>>That will create a datatable with 1 column (City), and a unique list of the cities.
>>
>>If you need to use more than one column to determine uniqueness (say, City and Zip), you'd do it like this:
>>
>>
>>DataTable dtUniqueCities = MyDataSet.Tables["Customers"].DefaultView.ToTable(true, new string[] {"City", "Zipcode"}); 
>>
>>
>>which will give you a DataTable with two columns, City and Zipcode, containing a unique combination of the two column values.
>>
>>~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform