Transactions in a hierarchical disconnected dataset

G

Guest

Hi

I have a disconnected strongly typed dataset with around a 10 depth
hierarchy of related tables.

I am using windows.forms to hierarchically display the parent, child,
grandchild etc. etc. data. Each form represents a level in the hierarchy and
contains a Save and Cancel button. I want these buttons to accept or reject
all the modifications made lower in the hierarchy so that even though the
grandchild data has been saved, if the child is cancelled then all child and
grandchild data is rejected. All this must be done whilst being disconnected.

Any help would be most appreciated.
 
K

Kevin Yu [MSFT]

Hi Terry,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to accept and reject all child
and grandchild data when the parent data is accepted or rejected in a
hierarchy or related tables. If there is any misunderstanding, please feel
free to let me know.

This is very hard to achieve in a DataSet, because when you have called
AcceptChanges method in a DataTable, all the change information is
submitted and the changes cannot be rolled back. Since you have mentioned
the child data modification has to be rejected even though the data has
been saved, we need some other operations to achieve this.

When a Save button is clicked, we can try to set a flag for that form to
indicate the table is going to be updated. But actually, we don't really
update that table. When all manipulations are done, we find the highest
form whose flag has been set and update this table and all it's child
tables.

Also, when a Cancel button is clicked, we call RejectChanges on this table
and all its child tables. And set the flags to not update.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
G

Guest

Hi Kevin

Yes I can see what you mean, but I need to display the most up-to-date (i.e.
proposed or current) data on each of the forms before the final save/cancel.
It looks like the only way to do this would be to examine each of the
datarows and display either the current or proposed data. I woun't be able to
bind doing this though so it would all be pretty manual.

Is there any kind of 'internal' transactions within the dataset of .net 2.0?
 
K

Kevin Yu [MSFT]

Hi Terry,

Sorry, but as far as I know, there isn't such 'internal' transaction in the
ADO.NET 2.0.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top