一个SqlTransaction 事务的问题
anlsg 2010-08-25 02:26:28 //connection.Open();SqlTransaction st;
.
.
.
try
{
//操作
aa();
st.commit();
}
catch (Exception e)
{
st.Rollback();
return e.message;
}
finally
{
st.Dispose();
}
private void aa()
{
//插入删除修改操作
}
e.message="ExecuteReader requires the command to have a transaction when the connection assigned to the command is in a pending local transaction. The Transaction property of the command has not been initialized."
求助,如果方法aa的操作放在try中就不会出现问题,我只想把这个操作放在外面,请问有没方法解决