I have what I believe to be a typical master/detail scenario. I know how to
use a transaction on the sql updates, but what about any dataset merges? My
scenario goes like this:
// call data layer to add new header record, get back auto-inc keys
// call data layer to do all updates on detail tables, assign auto-inc keys
from header where necessary
// call data layer to do update, delete operations, if necessary, on header
record
That's the sql code, which is easy enough to do in a transaction. However,
now I need to merge the datasets returned from the data layer (possible new
auto-inc, timestamp values, etc.) with the datasets on my windows form. It
would go something like:
// merge header dataset from data layer with dataset on windows form
// merge detail dataset(s) from data layer with dataset(s) on windows form
The issue I have if what if something goes wrong in one of those merge
operations? I can roll back the sql commands, but I can't "roll back" the
previous dataset merges.
Would System.Transactions help here? Would that roll back both the sql
commands and the dataset merges? The help file is still sparse on this new
feature of 2.0.
TIA,
Mike Rodriguez