DataSet and Table join

  • Thread starter Thread starter dmsy
  • Start date Start date
There is not an exact equivalent of a SQL join, but you can use the
dataRelation object. You may find it interesting if you want to do a
master/detail form.
In that case the dataSource for the detail control will not be a
dataTable but the dataRelation object( for a dataGrid object the
source will be the dataset and the member the datarelation path, for
instance "mymastertable.myrelation") This will display only child
records of the parent's table selected item.

For instance use this code to create a dataRelation
dr= new DataRelation("Relation_Name", new DataColumn[] {
MyPrimarykeydataColumn}, new DataColumn[] {
myForeignkeydataColumn}, false);
myDataSet.Relations.Add(dr);

hope this helps

Oracle Vs Microsoft

http://oraclevsmicrosoft.blogspot.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top