473,809 Members | 2,506 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to make Dataset relationships behave like an SQL join

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
2 2115
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
378
by: Simon Harvey | last post by:
Hi everyone, I was wondering if it is possible, to use SQL to return more than one table at a time into a dataset. I only know the basics of SQL and so I'm not sure if I'm just asking a stupid question. But, I'm not proud! :-) I'm using Ado.net and I'm wanting to load a DataSet object with several independent tables. (For those who arent ADO.net programmers, a DataSet can hold multiple tables and the relationships and contraints...
6
1959
by: Chuck Van Den Corput | last post by:
I have an application with one main table with a jillion attributes. There are numerous other tables, but these are either children of the main table or lookup tables. I am finding that I am using up all my indices on the main table to support the relationships with all the child and lookup tables. My question is this: would anyone suggest or caution against the use of tables that are related to the main table in a 1:1 relationship?
1
2589
by: Gandalf | last post by:
I'm creating relationships between tables using VBA and ADOX. I can create one-to-one relationships with an inner join, but I can't figure out how to create these relationships with an outer join (specifically a left outer join). I'm including the code that creates the relationships with the inner join. Any help or suggestions would be greatly appreciated. Thanks! <----- CODE FOLLOWS ----->
2
6129
by: Gandalf | last post by:
I'm creating relationships between tables using VBA and ADOX. I can create one-to-one relationships with an inner join, but I can't figure out how to create these relationships with an outer join (specifically a left outer join). I'm including the code that creates the relationships with the inner join. Any help or suggestions would be greatly appreciated. Thanks! <----- CODE FOLLOWS ----->
0
1431
by: Steve | last post by:
I have a dataset. I fill it with two recordsets from SQL queries. Tables are called tblPlanFYSpendingStage, tblSpendingStage.
1
1669
by: Ivan Weiss | last post by:
Hey all, I have the following code to populate a ListView control from my Access database. The listview is displaying a list of saved projects that the user will be able to open, edit, or delete to work on. I know that the DataReader is more efficient and faster than a dataset, but I was not able to figure out how to implement it. Here is the code I have now which works: Private Sub frmProjects_Load(ByVal sender As System.Object,...
9
12991
by: jaYPee | last post by:
I have search a lot of thread in google newsgroup and read a lot of articles but still i don't know how to update the dataset that has 3 tables. my 3 tables looks like the 3 tables from northwind database that has an employees, orders, and order details. the following are the 3 tables in my sql database students schyrsem
1
1838
by: cpnet | last post by:
I'm trying to create a Crystal Report based on a strongly-typed DataSet (that I'm populating manually instead of from a database). This is almost working except Crystal seems to always do inner joins along the relationships in the DataSet, but I want an outer join. I have a table (QuestionTable) that's a list of questions. Each row contains the question, as well as the foreign key to a row in AnswerTable (which contains the...
1
1654
by: laura | last post by:
I am new to Access, trying to figure it out on my own. I am trying to create a form to input the same information in 3 different tables. The 3 tables each have a different number as the primary key, although they each do contain the other 2 numbers in their tables. I have been unsuccessful and am wondering if perhaps my relationships are inaccurate.
0
9722
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10643
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10378
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10391
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7664
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3862
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.