Go Premium for a chance to win a PS4. Enter to Win


DataRelation Object vs. INNER JOIN

Posted on 2004-10-21
Medium Priority
Last Modified: 2008-02-01
Being new to C# (about 1 week), I saw that there is a DataRelation object in ADO.Net.  From what I have gathered so far is that one can add multiple tables into a DataSet and use the DataRelation object to establish the relationship between the tables inside the same DataSet.  

Now, what I am wondering is:  Isn't that what inner joins are for?  If so, when would one use a DataRelation Object as opposed to an INNER JOIN?


Question by:brdrok
  • 2
  • 2
LVL 20

Expert Comment

ID: 12370735
Inner joins are used in selects inside the database. In most cases the two tables have also a relation, but this is not obligatory.

The relationship object shows a relation in your dataset. Based on this relation you can programmatically get all child records or the parent record in this relation, however all objects must be pre-loaded from the database.

Author Comment

ID: 12370956
thanks a lot....i suppose one uses the datarelation object when, for example, showing the parent-child(ren) records inside a datagrid?!?

on a totally different subject (if you need more points, let me know)....

if one has applied the rowFilter and filtered the dataset according to whatever specifications....is there a method that will allow the programmer (me in this case hehehehe....) to restore the default/original view w/o having to clear and "re-load" the dataset?


LVL 20

Accepted Solution

TheAvenger earned 300 total points
ID: 12372989
Just set the RowFilter to null - this will clear it

Author Comment

ID: 12373264
cool beans...thanks...

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question