Link to home
Start Free TrialLog in
Avatar of brdrok
brdrok

asked on

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

Avatar of TheAvenger
TheAvenger
Flag of Switzerland image

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.
Avatar of brdrok
brdrok

ASKER

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

ASKER CERTIFIED SOLUTION
Avatar of TheAvenger
TheAvenger
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of brdrok

ASKER

cool beans...thanks...