Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select from datatable with group by
Message
From
19/02/2007 00:20:29
 
 
To
18/02/2007 23:12:34
General information
Forum:
ASP.NET
Category:
ADO.NET
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01196976
Message ID:
01196977
Views:
10
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
Previous
Reply
Map
View

Click here to load this message in the networking platform