How to remove certain rows from dataset table

  • Thread starter Thread starter Mika M
  • Start date Start date
M

Mika M

Hello,

I think this is quite newbie question...

I have DataSet with tables "Parent" and "Child", and relation one to many
between these tables. How can I remove rows from Child -table where for
example ParentID = 5, and leaving Parent tables parent row as is ? How to do
this using code.

Propably ds.Tables("Child"). ... ?
 
You might do the following:
foreach (DataRow row in
ds.Tables("Parent").Rows(yourrowindexhere).GetChildRows("relationnamehere"))
row.Delete();
 
Back
Top