事务管理器不可用

时间:2014-07-04 11:59:45

标签: c# .net transactionscope

我正在使用.Net

提供的 TransactionScope

然而,当我尝试打开连接时,它会抛出异常。

{System.Runtime.InteropServices.COMException (0x8004D01B): The Transaction Manager is not available. (Exception from HRESULT: 0x8004D01B)

这是我的代码..

  using (TransactionScope scope = new TransactionScope())
  {
    using (OleDbConnection connection1 = new OleDbConnection("Provider=MSDAORA.1;User ID=oratest2;Password=oratest2;Data Source=dr;Persist Security Info=False"))
     {
                    // Opening the connection automatically enlists it in the  
                    // TransactionScope as a lightweight transaction.
       connection1.Open(); // here it throws exception
     }
  }

0 个答案:

没有答案