B
Brian Scott
I have created a transaction and attached it to the dataadapter of my
dataset in question. When an exception is raised before the transaction is
commited the transaction is rolled back.
The problem I am having is that although the transaction rollback has
stopped the new datarow from being inserted into the underlying database, it
is still being added to the dataset object. I am using DataAdapter.Update on
my Datatable within the Dataset and then running an SqlCommand after this to
communicate with the database directly. If there is an exception when I rund
the SQLCommand which is after the DataAdapter.Update the information is
stopped from enterring the database but still added to the dataset even
though the transaction failed.
I have tried catching the exception raised by the SqlCommand use and calling
DataTable.RejectChanges but the changes have been accepted after the
succesfull DataAdapter.Update.
Am i doing something wrong here?
dataset in question. When an exception is raised before the transaction is
commited the transaction is rolled back.
The problem I am having is that although the transaction rollback has
stopped the new datarow from being inserted into the underlying database, it
is still being added to the dataset object. I am using DataAdapter.Update on
my Datatable within the Dataset and then running an SqlCommand after this to
communicate with the database directly. If there is an exception when I rund
the SQLCommand which is after the DataAdapter.Update the information is
stopped from enterring the database but still added to the dataset even
though the transaction failed.
I have tried catching the exception raised by the SqlCommand use and calling
DataTable.RejectChanges but the changes have been accepted after the
succesfull DataAdapter.Update.
Am i doing something wrong here?