E
Erik Frey
Hi,
I rely on the SqlDataAdapter to do most of the work in my data layer.
The SqlDataAdapter uses DataRowState to decide what command to execute with
a given row, and then afterwards calls AcceptChanges on the row to render it
back to Unchanged, or remove it from the table.
My question is this:
I sometimes need to perform a number of DataAdapter operations, all in
one atomic go, so I use connection.BeginTransaction, then run a couple of
DataAdapter.Update() methods, then
transaction.Commit()/transaction.Rollback() depending on whether I encounter
an error.
If I -do- encounter an error, and rollback my transaction, is there a
reliable way to rollback my local datasets too, so that the datarows reflect
their original RowState before SQLDataAdapter bulldozed over them?
Thanks,
Erik
I rely on the SqlDataAdapter to do most of the work in my data layer.
The SqlDataAdapter uses DataRowState to decide what command to execute with
a given row, and then afterwards calls AcceptChanges on the row to render it
back to Unchanged, or remove it from the table.
My question is this:
I sometimes need to perform a number of DataAdapter operations, all in
one atomic go, so I use connection.BeginTransaction, then run a couple of
DataAdapter.Update() methods, then
transaction.Commit()/transaction.Rollback() depending on whether I encounter
an error.
If I -do- encounter an error, and rollback my transaction, is there a
reliable way to rollback my local datasets too, so that the datarows reflect
their original RowState before SQLDataAdapter bulldozed over them?
Thanks,
Erik