473,385 Members | 1,470 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

GetChildren doesn't return 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

Nov 16 '05 #1
2 2378
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: raffe | last post by:
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...
0
by: rao | last post by:
I am trying to get sub nodes for for clicked node using getChildren() method as shown below. I am getting javascript exception error (subtree.null )when nodes are not expanded. The code works only...
2
by: Russell Smith | last post by:
Postgresql 7.4.5 The following VACUUMs were run within a couple of minutes of each other completing. This table concerned is a table that has not been changed in a long time. (a month) There...
4
by: Joris De Groote | last post by:
Hi, (my code is @ the bottom of this message) I have a piece of code that runs the rows of a dataset until it finds the one needed. When he finds it, I delete that row and start all over...
6
by: BrianDP | last post by:
I have a table that has always been in my back-end of this application. The table is getting quite large, and, on top of that, we lose records out of this table. They just dissappear! No rhyme or...
4
by: =?Utf-8?B?cmFuZHkxMjAw?= | last post by:
I'm working in Visual Studio 2005 and C#. I have a DataTable with many rows. The user can delete a row. After the row is deleted, I'd like to column values for the deleted row, but any attempt to...
3
by: Phil Stanton | last post by:
I have a form based on a complex query (Lots of tables) If I delete a record, everything appears to be OK. Get the message "Youa are about to delete 1 record ....". I say yes. The record count...
0
by: ZSvedic | last post by:
Hi all, I need to display DataRows with RowState.Deleted inside DataGridView, in a way that such rows have strikethrough font. Here is the screenshot how it should look like:...
0
by: ebernon | last post by:
The Dynamic deletion of Rows and Columns within a program is frequently desired but often hard to obtain. The Help files for VB-6 contained within Excel 2002 (XP) don’t always provide the help you...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.