472,992 Members | 3,436 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,992 software developers and data experts.

how to fill typed dataset with joined queries ?

hi ,

I have 2 tables , tUser and tUserRole and I have a query like :

select * from tUser inner join tUserRole on tUserRole.UserId=tUser.UserId
where tUser.UserId=1

this will return a user with associated roles.

Also I have a typed dataset with two tables inside : tUser and tUserRole

how can I use this typed dataset when I use the query above ? What is the
expected behaviour ? Should I fill
two tables of the dataset with seperate queries like :

select * from tUser where UserId=1
select * from tUserRole where UserId=1

or is there any other better way ? I wonder because there are more complex
joined queries from database.I have to map them to the dataset.

Nov 19 '05 #1
1 3148
You need to make your mind what you want. If you want to work against 2
tables, you have to run 2 separate queries, like you write. You can't fill 2
tables from one select query. You can do it with a stored procedure or a
batch query that return 2 recordsets.

You may decide that you need only one table. For example, if you want to
show both user and user role fields in the same grid. Than you should make
just one table that will contain fields from the joined select.

Eliyahu

"Ersin Gençtürk" <ers[spam]@gencturk.org> wrote in message
news:ef**************@TK2MSFTNGP15.phx.gbl...
hi ,

I have 2 tables , tUser and tUserRole and I have a query like :

select * from tUser inner join tUserRole on tUserRole.UserId=tUser.UserId
where tUser.UserId=1

this will return a user with associated roles.

Also I have a typed dataset with two tables inside : tUser and tUserRole

how can I use this typed dataset when I use the query above ? What is the
expected behaviour ? Should I fill
two tables of the dataset with seperate queries like :

select * from tUser where UserId=1
select * from tUserRole where UserId=1

or is there any other better way ? I wonder because there are more complex
joined queries from database.I have to map them to the dataset.


Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: suzy | last post by:
hello. how can i sort data in a dataset? all the examples i have seen on msdn, etc are sorting a dataview. this works fine, but i want to return the results in xml and the dataview doesn't...
3
by: MC D | last post by:
I have a situation in which I have a strongly typed dataset based on the schema of a xml document. This works great, and OMG I love strongly typed datasets... ;o) However, The situation I have...
2
by: Stanav | last post by:
Hello all, I'm developing a web application using VB.Net 2003 and Framework 1.1. This application queries an AS/400 database. I'm using the IBM OleDb provider that came with IBM Client Access for...
4
by: Dave Edwards | last post by:
I understand that I can fill a datagrid with multiple queries, but I cannot figure out how to fill a dataset with the same query but run against multiple SQL servers, the query , table structure...
1
by: Nikolay Petrov | last post by:
How to fill dataset with multiple tables and set their relaition? Can I get the relations from the SQL server? Also I would like to do it using stored procedures. TIA
5
by: moondaddy | last post by:
I have a website where cataloge pages are populated by calling a stored procedure on sql server. I use the sql data adapter's fill method to call this stored procedure and fill the dataset. about...
3
by: Stanav | last post by:
Hello all, I'm developing a web application using VB.Net 2003 and Framework 1.1. This application queries an AS/400 database. I'm using the IBM OleDb provider that came with IBM Client Access for...
4
by: Andre | last post by:
I am ruinning this in the global.asa VIA Visual Studio VB .NET (framework 1.1) I have a access database with a table called tblCounters with a feild called Counters with on row of data in it...
5
by: Monty M. | last post by:
Hello; I was wondering if anyone can assist me with this problem. Here are the tools I am using: Language: C# Database: MS SQL Server 2000 Application: Visual Studio 2005 1. I have a...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.