GetChildren doesn't return deleted rows.

  • Thread starter Thread starter Lateralus [MCAD]
  • Start date Start date
L

Lateralus [MCAD]

raffe,
Have you tried
TableA.GetChanges(System.Data.DataRowState.Deleted);

This will return all you're deleted rows.
 
Hi all.

I'm struggeling with a problem. I trying to do something very simple.

I have a DataSet containing two tables TableA and TableB. I use
TableA.GetChildren("relationName") in order to get an DataRow[] array
containing all children rows of TableA in TableB. Then I'm sending the
DataRow[] array as parameter into a DataAdapter.Update method.

The problem is that the DataRow[] array doesn't contain the rows I called
the Delete method on. So they won't get deleted! I am aware of the fact that
as a second parameter in GetChildren you can send in DataRowVersion. I've
tried all the DataRowVersion alternatives and I don't get the deleted rows.

Would it be that it's impossible to get DataAdapter.Update method to work
peoperly doing like this:
DataAdapter.Update(TableA.GetChildren(somerelation))?

Please help!

Rafael
 
Yeah, I know there are other ways. But I was partuculary interrested in
using GetChildren function cause it's part of my design where I have my
business layer objects wrapped around DataRows. I ended up writing my own
GetChildren method, which was based on the DataTable.Select method which
works in the same maner as you suggest.


Thanks for your advice.

Rafael.
 
Back
Top