By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,841 Members | 854 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,841 IT Pros & Developers. It's quick & easy.

How to make Dataset relationships behave like an SQL join

P: n/a
DataSet relationships seem to be focussed on one to many type realtionships.
I have got a one to one realtionship in a DataSet between two tables. I
can't do a join between the two tables in the database because the tables
come from different databases (although held on the same server). However
what i want is a single set of data that combines the fields like you get
with an SQL join. Is there a straight forward way of doing this that i am
missing because the only way i can see is to iterate through the parent table
calling GetChildRows for each record and then sticking each individual value
in a third seperate DataTable. Is there an easier way to do this?
Jul 25 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Have you tried to do a join in the SQL Statement first? I think you may very
well be able to, regardless of the fact that the two tables come from
different databases.
Just use the fully qualified name of each with an alias.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"clickon" wrote:
DataSet relationships seem to be focussed on one to many type realtionships.
I have got a one to one realtionship in a DataSet between two tables. I
can't do a join between the two tables in the database because the tables
come from different databases (although held on the same server). However
what i want is a single set of data that combines the fields like you get
with an SQL join. Is there a straight forward way of doing this that i am
missing because the only way i can see is to iterate through the parent table
calling GetChildRows for each record and then sticking each individual value
in a third seperate DataTable. Is there an easier way to do this?
Jul 25 '06 #2

P: n/a
Oooh it works, i didn't know you could do that. Thanks that makes my life so
much easier.

"Peter Bromberg [C# MVP]" wrote:
Have you tried to do a join in the SQL Statement first? I think you may very
well be able to, regardless of the fact that the two tables come from
different databases.
Just use the fully qualified name of each with an alias.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"clickon" wrote:
DataSet relationships seem to be focussed on one to many type realtionships.
I have got a one to one realtionship in a DataSet between two tables. I
can't do a join between the two tables in the database because the tables
come from different databases (although held on the same server). However
what i want is a single set of data that combines the fields like you get
with an SQL join. Is there a straight forward way of doing this that i am
missing because the only way i can see is to iterate through the parent table
calling GetChildRows for each record and then sticking each individual value
in a third seperate DataTable. Is there an easier way to do this?
Jul 25 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.