zoukankan      html  css  js  c++  java
  • TransactionScope 事物

     public void UpdataMdiDt(DataTable[] dt, SqlDataAdapter[] dpt, out short signErr, out string strErr)
            {
                signErr = 1; strErr = "";
                using (TransactionScope ts = new TransactionScope())
                {
     
     
                    SqlConnection conn = new SqlConnection(constring);
                    conn.Open();
                    if (signErr == 0) return;
                    try
                    {
                        SqlCommandBuilder[] scb = new SqlCommandBuilder[dt.Length];
     
                        for (int i = 0; i < dt.Length; i++)
                        {
                            scb[i] = new SqlCommandBuilder(dpt[i]);
                            dpt[i].Update(dt[i]);
                        }
                        ts.Complete();
     
                    }
                    catch (Exception ex)
                    {
                        signErr = 0;
                        strErr = ex.ToString();
                    }
                }
     
            
  • 相关阅读:
    Getting started with the Web ADF
    将搜狗浏览器设置为IIS的默认浏览器
    What is installed with the Web ADF?
    如何修改Flex的默认浏览器
    What is the Web Application Developer Framework
    windows C++获得本地IP地址
    lua table函数库
    【铸铁】C++服务器面试题.doc
    VC2008下提示找不到MSVCP90D.dll的解决办法
    排序
  • 原文地址:https://www.cnblogs.com/jazzka702/p/2781485.html
Copyright © 2011-2022 走看看