Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select to a temporary cursor
Message
De
17/12/2008 23:05:57
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01365559
Message ID:
01368391
Vues:
10
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform