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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing information in a deleted DataRow

Status
Not open for further replies.

byleth

Programmer
Feb 27, 2004
70
0
0
PT
Hi,

I'm using strongly typed datasets.

Somewhere in my application i need to access the child rows of a deleted datarow:

deletedRow.GetChildRows

in which i get an exception saying i can't access deleted row information.

i know i can do something like deletedRow.Item("colName", DataRowVersion) but what i need is the child rows and parent rows...

Is there any workarround for this?


thanks in advance
 
A quick solution you might try if it's possible in your scenario:

use deletedRow.rejectchanges to reset your rowstate to unchanged, get your child rows, then delete the row again
 
Hi SavantMan,

Thanks for your tip..

the thing is that i'm using constraints and relations in a strongly typed dataset, if i change the rowstate of a deleted row that eventualy has it's parent row with the row state marked as deleted as well, wouldn't i end up getting a constraint error..?

I've found a (bad) solution: a hashtable in which the key is the parent row and the value is an array of deleted childs..

it works but i don't like it.



 
Byleth,

You're correct --- if you're deletedRow is a child and it's parent's are deleted, my suggestion won't work. Your solution isn't pretty, but better than anything else I can think of. Someone else here may have a better solution.
 
Umm, if it's deleted, why are you even trying to access it?

Maybe you need to store a cache of "recently deleted, but I might need it anyway" data.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
hi chiph,

I need it because i'm updating the dataset recursively.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top