Update Question

R

Rick

Hi,

In updating the db I use datasets with a data adapter. Each dataset has
multiple tables with a parent-child relationships. With that in mind, my
update has a hierarchical order to it in which I use a transaction object.
When I pass my dataset to the dataadpater for each table I call
AcceptChanges() method after the update. If there is an error I rollback
all updates via the transaction object, how can I roll back the
AcceptChanges on each datatable?

Thanks
 
W

William Ryan eMVP

Update calls acceptchanges for you as it updates each row. You don't need
to call it again afterward. There is no rollback on it... you'll need to
make a copy of the datatable for instance if you need to get this info back.
 
R

Rick

Thanks,

If, for some reason there is an error and the app rollbacks the update.
What is the best way to get around this with the DataSet?

Thanks again
 
W

William Ryan eMVP

You could use the ContinueUpdateOnError which will keep trying and submit
what it can. May or may not be a fit here, really depends on the ultimate
update strategy.
 
R

Rick

Is there a good article or website that discusses different update
strategies?

Thanks
 

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