have a DataTable with an autoincrement primary key that is retrieved
from the database after insert.
When I execute my InsertCommand within an SqlTransaction the rows in the DataTable are updated with the autogenerated key from SQL Server.
However, when one of the inserts fail and I rollback the entire
transaction, all my DataRows are left with the invalid keys from the
database and a RowState of DataRowState.Unchanged instead of
DataRowState.Added.
So, when I rerun this code:
Me.DataAdapter.Update(Me.Table)
nothing happens. No inserts are performed. This kind of defeats the
purpose of having an SqlTransaction. No changes are made to the
database, but permanent changes are made to the DataTable. Is this a
bug A feature Can anyone help me with a workaround

sqlTransaction problem
Johan Lindfors - MSFT
Create a copy of the dataset using either dataset.Copy() or dataset.GetChanges()
Run the update against the copy and if it fails just release it, else acceptchanges on the original.
Firemarble
JimJBq
ASHAIKH
Newland