我收到以下錯誤,當我嘗試調用包含SELECT語句的存儲過程:「操作是無效的事務的狀態」錯誤和交易範圍
操作不適用於該交易
這裏的狀態是我的電話的結構:
public void MyAddUpdateMethod()
{
using (TransactionScope Scope = new TransactionScope(TransactionScopeOption.RequiresNew))
{
using(SQLServer Sql = new SQLServer(this.m_connstring))
{
//do my first add update statement
//do my call to the select statement sp
bool DoesRecordExist = this.SelectStatementCall(id)
}
}
}
public bool SelectStatementCall(System.Guid id)
{
using(SQLServer Sql = new SQLServer(this.m_connstring)) //breaks on this line
{
//create parameters
//
}
}
與我創建另一個連接問題離子到交易中的同一個數據庫?
我偶然發現了同樣的情況。我必須在同一個事務範圍內引用兩個不同的數據庫。謝謝你的提示。 – rageit 2012-04-09 12:52:32