当我尝试调用包含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
//
}
}
Run Code Online (Sandbox Code Playgroud)
我在问题中创建了另一个与同一数据库的连接的问题吗?