|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
DataSet and Table joinIf you mean join query, I suppose not.
Elton Wang >-----Original Message----- do join in SQL?>Is there a way to join DataTables, kind of like how you Show quote > >. > 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 You might also want to check out this web-site that promises to provide a
..NET component to allow full SQL syntax queries against a DataSet. http://queryadataset.com Hope this helps Ad. Show quote "dmsy" wrote: > Is there a way to join DataTables, kind of like how you do join in SQL? > > |
|||||||||||||||||||||||