Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select from datatable with group by
Message
De
19/02/2007 00:20:29
 
 
À
18/02/2007 23:12:34
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
01196976
Message ID:
01196977
Vues:
12
John,

This returns a DataTable rather than a DataRow, but I think it might be what you want:
	// Produces a new table containing unique values for data in the specified columns.
	DataTable dt;
	dt = this.myDataTable .DefaultView.ToTable(true, "location");
The "true" parameter tells it that you want distinct locations.

~~Bonnie




>Hi,
>How could I retrieve datarow as sql below from datatable which its data still in datatable but not yet saved in database?
>
>
SELECT location from myDataTable GROUP BY location
>
>Thank you
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