How to use TransactionScope in C#?

前端 未结 7 1084
猫巷女王i
猫巷女王i 2020-11-29 23:55

I am trying to use TransactionScope, but keep getting the exception below.
The app is running on a different machine than the database, if that matters. I

7条回答
  •  温柔的废话
    2020-11-30 00:16

    Depending on the backend you are using, TransactionScope often requires the Distributed Transaction Manager to be enabled. Some details are on this MSDN blog.

    Also, if you use multiple resources, DTC may be required. Enabling DTC may be required in your situation, or making sure you're using SQL Server 2005 and sticking to what would be doable in lightweight transactions.

提交回复
热议问题