SqlTransaction事务和Response.Redirect

111错误代码
     ObjectOperator oo = new ObjectOperator();
        oo.BeginTranscation();
       
try
        {
            oo.Commit();
             Response.Redirect(
" TeamCustomerAdd.aspx " );
         }
       
catch (Exception ex)
        {
            oo.Rollback();
            PageTools.Alert(ex.Message);
           
return ;
        }
       
finally
        {
            oo.Dispose();
        }
正确的代码
 ObjectOperator oo = new ObjectOperator();
        oo.BeginTranscation();
       
try
        {
            oo.Commit();
        }
       
catch (Exception ex)
        {
            oo.Rollback();
            PageTools.Alert(ex.Message);
           
return;
        }
       
finally
        {
            oo.Dispose();
        }
        Response.Redirect(
"TeamCustomerAdd.aspx");

你可能感兴趣的:(transaction)