 |
| ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

July 20th, 2004, 06:33 PM
|
|
Registered User
|
|
Join Date: Jul 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
query of dataset
I have created a dataset with multiple tables including the relationships. I need to query the tables in the dataset to create a table of DISTINCT records that have fields from multiple tables. I would know how to do this with the SQL language, but don't know what functions to use in an existing dataset. A dataview won't work because that only filters a single table. Any iteas?
|
|

July 21st, 2004, 09:29 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Hey,
Can you union all of the entire result sets in the SQL query, then use a DataView to filter the result sets? Or, can you do it at the SQL query level? That may be the easiest. To get distinct records from multiple tables, you may have to loop through each table to compare the result sets.
Brian
|
|

July 21st, 2004, 10:02 AM
|
|
Registered User
|
|
Join Date: Jul 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
bmains,
Thanks for the reply. I can't union them all, because i'd never get the distinct set that I need. I was hoping that I wouldn't have to do the filtering at the SQL query level, because it will mean several specialized stored proceedures, since I am allowing user driven filtering of the main recordset.
I am trying to use the distinct records to populate two different dropdownlists with only the options available in the main recordset.
|
|

July 21st, 2004, 12:28 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Hey,
Well then the only other thing I can think of adding is to select the data from one recordset and use a DataView to query the other recordset. Then if there is any rows returned from the DataView delete them from the datatable, or do something with them, whatever your desired action is.
How's that?
Brian
|
|

July 24th, 2004, 02:15 AM
|
|
Friend of Wrox
|
|
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Why you don't use DataRealation object in your dataset..
I think you can declare a DataRealation object then determine your parentcolumn and childcolumn then in your dataset object add your realation object...
here by looping through all the rows of your parent column and retriving them (through GetChildRows("youRealation"))you would have an array that includes your child rows then again you can loop in this array for obtaining your rows corresponding the parent column....
Hope this can help you...
--------------------------------------------
Mehdi
I'm waiting for your better idea.
|
|

July 24th, 2004, 05:57 AM
|
|
Friend of Wrox
|
|
Join Date: Oct 2003
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
i was already need to do some thing like that
my problem was to query many tables and i got 2 tables and i cached them and i was need to query them again in .net but failed to easy deal as i write queries so i finaly do that using loops
Ahmed Ali
Software Developer
|
|

July 28th, 2004, 08:28 AM
|
|
Registered User
|
|
Join Date: Jul 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
|
 |