Join Tables in DataSet

  • Thread starter Kai =?iso-8859-1?Q?Br=E4utigam?=
  • Start date
K

Kai =?iso-8859-1?Q?Br=E4utigam?=

Hi,

is there any way to join two tables in a DataSet? What I need is just like
a JOIN with two tables in a real Database like:

SELECT cu.CustomerID, or.OrdersID
FROM Customers cu, Orders or
WHERE cu.CustomerID = or.CustomerID

or

SELECT cu.CustomerID, or.OrdersID
FROM Customers cu
INNER JOIN Orders or
ON cu.CustomerID = or.CustomerID

I've found the QueryADataSet from Peersoft, which works fine as far as I
can see. Anyone got some experiences with that library?

Maybe any other ideas to solve that problem?

Thanks,
- Kai
 
K

Kai =?iso-8859-1?Q?Br=E4utigam?=

Hi Jignesh,
Joining tables in DataSet
Use DataSet.Relations

Sounds good, but could you be a bit more specific?
Maybe a short example?

Thanks in advance,
- Kai
 
A

Adrian Moore

Kai,

I'm the developer from Peersoft who built the QueryADataset assembly. As
this is a brand new product, I don't have any references yet. However, there
are several users actively using the product, mostly for displaying web
content from cached Datasets.

If you are more comfortable working with SQL than writing ADO code, then the
QueryADataset product is a good investment.

Feel free to e-mail me if you have any comments or questions.

Thanks
Adrian Moore
http://www.queryadataset.com


----- Original Message -----
From: "Kai Bräutigam" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.adonet
Sent: Tuesday, August 09, 2005 1:16 AM
Subject: Join Tables in DataSet
 
K

Kai =?iso-8859-1?Q?Br=E4utigam?=

Hi Miha,
Why do you need to join them?
Just for displaying data?

no. it's not just for displaying. Mostly I need to work with the data. It's
a web-application with hundreds, maybe thousands of joins I need to do each
request. So I decided to use a DataSet, because I realized regular
SQL-Statements(StoredProcedures) directly to the database are too slow. And
now I'm looking for a fast!!! solution to do JOIN-statements with the
DataSet.

- Kai
 
M

Miha Markic [MVP C#]

Hi Kai,

Actually, database join statements are normally faster if they are properly
set (indexes).
Perhaps you hae a problem in database structure?
 
K

Kai =?iso-8859-1?Q?Br=E4utigam?=

Hi Miha,
Actually, database join statements are normally faster if they are properly
set (indexes).
Perhaps you hae a problem in database structure?

I know about indexes and how to set them for fast queries. So my problem is
not the database. As you said, normally they are faster, but they aren't in
this special case.

So I need to work with the DataSet and if you have an idea about joining
the tables inside, just let me know... :)

- Kai
 
M

Miha Markic [MVP C#]

Hi Kai,

Kai Bräutigam said:
Hi Miha,


I know about indexes and how to set them for fast queries. So my problem
is
not the database. As you said, normally they are faster, but they aren't
in
this special case.

Ok, if you say :)
So I need to work with the DataSet and if you have an idea about joining
the tables inside, just let me know... :)

Try one of two articles on the top if they help you:
http://support.microsoft.com/search/default.aspx?catalog=LCID=1033&query=join+dataset
 
A

Adrian Moore

Kai,

The join algorithms mentioned in these articles are not optimized and
perform poorly with large data tables. Also, they only provide the
algorithm INNER join, and not LEFT or RIGHT join.

Ad.

Miha Markic said:
Hi Kai,

Kai Bräutigam said:
Hi Miha,


I know about indexes and how to set them for fast queries. So my problem
is
not the database. As you said, normally they are faster, but they aren't
in
this special case.

Ok, if you say :)
So I need to work with the DataSet and if you have an idea about joining
the tables inside, just let me know... :)

Try one of two articles on the top if they help you:
http://support.microsoft.com/search/default.aspx?catalog=LCID=1033&query=join+dataset

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/
SLODUG - Slovene Developer Users Group www.codezone-si.info
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top