473,383 Members | 1,805 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 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 3169
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

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.