|
-
April 29th, 2003, 05:58 AM
#1
DataTable and SQL Queries
Is there an method or a way of preforming a SQL SELECT statement on a DataTable so that it returns a array of Rows?
The DataTable.Select() method won't do the job as my query is a bit too complex for me to use it.
This is my SQL query:
SELECT COUNTY_ID , NAME
FROM TOWNS
WHERE NAME IN
( SELECT NAME FROM TOWNS
GROUP BY NAME HAVING COUNT(*) > 1);
Do I need to use a SQLDataAdapter or something? Just a guideline on how I should go about doing this would be helpful.
Thanks
-
April 29th, 2003, 08:35 PM
#2
You could try using a SqlDataReader that is returned from the SqlCommand.ExecuteReader method.
Hope this helps.
That which does not kill us, only makes us stronger.
MCSD .NET
-
April 30th, 2003, 06:46 PM
#3
check SqlDataReader for more information.
SqlDataReader d;
// blah blah
// declaration and usage of d
object []a = new object[..]
d.GetValues(a);
Paresh
- Software Architect
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|