zoukankan      html  css  js  c++  java
  • 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");

  • 相关阅读:
    「CSP模拟」模拟测试6
    「CSP模拟」模拟测试5
    镇黑板
    求和「Dirichlet 前缀和」
    二叉搜索树「区间DP」
    序列
    [CSP模拟]异或帽子+传话游戏+全球覆盖+幂次序列
    MySQL常用引擎及优缺点
    Django项目远程开发环境搭建
    MySQL8.0安装与配置
  • 原文地址:https://www.cnblogs.com/aaa6818162/p/1575048.html
Copyright © 2011-2022 走看看