• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 889
  • Last Modified:

DataRelation Object vs. INNER JOIN

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?

Thanks

0
brdrok
Asked:
brdrok
  • 2
  • 2
1 Solution
 
TheAvengerCommented:
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.
0
 
brdrokAuthor Commented:
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?

thanks

0
 
TheAvengerCommented:
Just set the RowFilter to null - this will clear it
0
 
brdrokAuthor Commented:
cool beans...thanks...
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now