我收到以下错误,当我尝试调用包含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