Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use DataRelation to find a parent record without a child record?

Status
Not open for further replies.

dduva

Programmer
May 16, 2001
38
US
Can I use a DataRelation to find out which parent records in Table A do not have a child record in Table B? Or is there some other way to do this?
 
The following returns an array of datarows where the row in the parent table (table at index 0 in a dataset called ds) has no children in the table referenced in the data relation called Relation_Name.
Code:
DataRow[] dr = ds.Tables[0].Select("COUNT(Child(Relation_Name).ColumnName) = 0");
 
Ooops, sorry. Didn't notice which forum I was in....
Code:
Dim dr() As DataRow = ds.Tables(0).Select("COUNT(Child(Relation_Name).ColumnName) = 0")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top