R
Rahul
I am using VB.NET 2005 to program a Database Application, with Access 2003 as
the DB backend.
Every now & then, I have to make a series of updates to the tables as a
result of user actions. Either all of these updates should be performed or
none of them should be applied to the database.
ADO.NET provides transactions fo the purpose. So, I create OleDB commands
for each update.
Now, the problem is that when I set the command's Transaction property as:
command.Transaction=tx
and later try to commit or rollback the transaction using,
tx.Commit or
tx.Rollback
It gives me an exception saying that the transaction has already closed.
If I dont commit but simply set the command's transaction property, then
none of the update is applied to the database, even when no exception is
generated.
What is the solution to my problem????
the DB backend.
Every now & then, I have to make a series of updates to the tables as a
result of user actions. Either all of these updates should be performed or
none of them should be applied to the database.
ADO.NET provides transactions fo the purpose. So, I create OleDB commands
for each update.
Now, the problem is that when I set the command's Transaction property as:
command.Transaction=tx
and later try to commit or rollback the transaction using,
tx.Commit or
tx.Rollback
It gives me an exception saying that the transaction has already closed.
If I dont commit but simply set the command's transaction property, then
none of the update is applied to the database, even when no exception is
generated.
What is the solution to my problem????