Query against two DataTables

G

Guest

I have two DataTables with a foreign key between them and I can query each
DataTable and combine data.
Is there an easy way for me to make a query against the two, just like the
join query in SQL Server against two tables?
Or what is the best way to do it? I check on DataView and DataSet class and
won't let me do it.
 
M

Miha Markic [MVP C#]

Hi Roy,

The easiest way is to do it on the server (as you mentioned - with joins) as
there is no join support in ado.net (you can still do it manually).
 
A

Adrian Moore

Roy,

You might be interested in the assembly I've been working on at
http://www.queryadataset.com. Besides INNER JOINS, it lets you perform
complex SQL SELECT statements including UNION, OUTER JOINS, GROUP BY,
HAVING, ORDER BY, sub-queries, etc against the tables in a dataset.

It might be overkill for what you want, but it might be a useful tool too.

Adrian Moore
http://www.queryadataset.com


Miha Markic said:
Hi Roy,

The easiest way is to do it on the server (as you mentioned - with joins)
as there is no join support in ado.net (you can still do it manually).

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

Roy said:
I have two DataTables with a foreign key between them and I can query each
DataTable and combine data.
Is there an easy way for me to make a query against the two, just like
the
join query in SQL Server against two tables?
Or what is the best way to do it? I check on DataView and DataSet class
and
won't let me do it.
 

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