By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,294 Members | 2,681 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,294 IT Pros & Developers. It's quick & easy.

GetChildren doesn't return deleted rows.

P: n/a
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

Nov 16 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
raffe,
Have you tried
TableA.GetChanges(System.Data.DataRowState.Deleted );

This will return all you're deleted rows.
--
Lateralus [MCAD]
"raffe" <_g*******@hotmail.com_> wrote in message
news:41********@news.broadpark.no...
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

Nov 16 '05 #2

P: n/a
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.
raffe,
Have you tried
TableA.GetChanges(System.Data.DataRowState.Deleted );

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

Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.