A set of technologies in .NET for building web applications and web services. Miscellaneous topics that do not fit into specific categories.
Hi @AHSAN ALI,
You were using Database.BeginTransaction() before. While Database. BeginTransaction() is used only for database related operations transaction, System.Transactions.TransactionScope for mixing db operations and C# code together in a transaction.
From MSDN:
The System.Transactions infrastructure provides both an explicit programming model based on the Transaction class, as well as an implicit programming model using the TransactionScope class, in which transactions are automatically managed by the infrastructure.
The TransactionScope class provides a simple way to mark a block of code as participating in a transaction, without requiring you to interact with the transaction itself.
Useful links:
Database.BeginTransaction vs Transactions.TransactionScope
Implementing an Implicit Transaction using Transaction Scope
Best regards,
Lan Huang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.