How to BeginTransmit with two TabeAdapter method

  • Thread starter Thread starter ad
  • Start date Start date
A

ad

I use two TableAdapter update method to udpate the Database after user press
OK button.
The two TableAdapter will update two different tables in a database.

How can I do BeginTransmit-roolback when user press OK.
 
Hi,

I think you should use System.Transactions.TransactionScope, like
using (TransactionScope scope = new TransactionScope())
{
// do updates
scope.Commit();
}
 
I have tried TransactionScope.
But it fail when execute the second update method with message: Can't use
the MSDTC in the server.


Miha Markic said:
Hi,

I think you should use System.Transactions.TransactionScope, like
using (TransactionScope scope = new TransactionScope())
{
// do updates
scope.Commit();
}

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/


ad said:
I use two TableAdapter update method to udpate the Database after user
press OK button.
The two TableAdapter will update two different tables in a database.

How can I do BeginTransmit-roolback when user press OK.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top