我正在使用.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
}
}