473,484 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Query results from multiple table dataset

Hi people,
I'd like to know if it's possible to get DataRows containing data
from different tables that are part of one single dataset?

Example:

Dim ds As New DataSet("myDataSet")

'Load 3 tables with data from my DB
Dim tblEmployees As DataTable = FetchEmployeeData() 'Table name =
"Employees"
Dim tblEmployeeDetails As DataTable = FetchEmployeeDetailsData()
'Table name = "EmployeeDetails"
Dim tblTasks As DataTable = FetchTaskData() 'Table name = "Tasks"

ds.Tables.Add(tblEmployees)
ds.Tables.Add(tblEmployeeDetails)
ds.Tables.Add(tblTasks)

Dim str() As String
'Infer a schema that define the relations between tables based on the
EmployeeSchemaPath constant value
ds.InferXmlSchema(EmployeeSchemaPath, str)

ds.Select(???) ?
Am I on the right path?

Any suggestions?

Thanks a lot for reading!

Nov 30 '05 #1
2 1491
There is also a merge property...

"Stef" <st************@mittalsteel.com> schreef in bericht
news:11**********************@g49g2000cwa.googlegr oups.com...
Hi people,
I'd like to know if it's possible to get DataRows containing data
from different tables that are part of one single dataset?

Example:

Dim ds As New DataSet("myDataSet")

'Load 3 tables with data from my DB
Dim tblEmployees As DataTable = FetchEmployeeData() 'Table name =
"Employees"
Dim tblEmployeeDetails As DataTable = FetchEmployeeDetailsData()
'Table name = "EmployeeDetails"
Dim tblTasks As DataTable = FetchTaskData() 'Table name = "Tasks"

ds.Tables.Add(tblEmployees)
ds.Tables.Add(tblEmployeeDetails)
ds.Tables.Add(tblTasks)

Dim str() As String
'Infer a schema that define the relations between tables based on the
EmployeeSchemaPath constant value
ds.InferXmlSchema(EmployeeSchemaPath, str)

ds.Select(???) ?
Am I on the right path?

Any suggestions?

Thanks a lot for reading!

Nov 30 '05 #2
Pipo,
thank you for your quick answer.
Unfortunately, I don't see how .Merge can help in my situation because
I want to grab data from an employee and extract everything related to
him so I can fill a grid with those values or else, create an instance
of an employee class I made, etc...

Maybe I'm missing something?

If you still believe .Merge is the way to go, can you provide me with
an example?
I have checked MSDN examples about .Merge and tried some things but it
doesn't look like it's a solution that fits well my needs...

Thanks!

Nov 30 '05 #3

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

Similar topics

7
3960
by: Phin | last post by:
I need your HELP! I've seen all the posts on using Crystal Reports within vs.net (vb.net) and changing a SQL query at runtime. When I tried to pass in a dataset into the crystal report at...
1
6554
by: Charlie | last post by:
Hello, I have data in an Access table that I would like to export to multiple HTML tables. I would like to split the data in the Access table (about 92,000 records) into multiple HTML...
2
15024
by: Scott Cannon | last post by:
I am trying to query 3 tables all related by Clinet_ID. The Clients table, Monthly_Expenses table and Monthly_Income table. Each client can have 0>M instances of expenses, past due expenses, and...
2
5860
by: Matthew Kramer | last post by:
Once you have created a table through a query, is there a way to make that dataset into an Access "table" rather than a table/dataset generated by a query? Maybe someway to cut and paste the...
3
1819
by: Andrew Bourne | last post by:
I would like to insert multiple records into a table based on a query returned from the same table. For example a datareader returns 3 records containing the following records user1 file1...
1
1997
by: cindy | last post by:
Get data into datatable, add to dataset dsSearch " Get data into datatable, add to dataset dsSearch Using In-Memory SQL Engine join the tables and select the filenames from the join, add to...
4
2514
by: dancole42 | last post by:
So I have an invoicing database based on two main forms: Orders and OrderLines. Orders has fields like: OrderID BillingMethod OrderDate CreditCard CCExp OrdSubTotal ShippingCharge
3
2010
by: sar68 | last post by:
I'm using Access 2007 on windows vista. Intel T7400 with 2.16 GHz and 2 gigs of ram. 64 bit os. If I run a query that goes across multiple tables, I get sensible results. However, if I run a...
3
1571
by: t8ntboy | last post by:
I have a table that contains a field for the start time for each day of the week (e.g., MondayStart, TuesdayStart, WednesdayStart, FridayStart, SaturdayStart, SundayStart). I need a query that...
0
7082
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7214
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5407
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4845
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4529
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3041
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1359
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
592
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
235
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.