黄聪

论SEO对人类的重要性,请看我的博客:hcsem.com

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

OleDbCommand cmd = new OleDbCommand("", conn);
            conn.Open();
            OleDbTransaction tran = conn.BeginTransaction();
            cmd.Transaction = tran;

            try
            {
               
                foreach (string sql in values)
                {
                    cmd.CommandText = sql;
                    cmd.ExecuteNonQuery();
                }
               
                tran.Commit();
                return true;
            }
            catch (Exception)
            {
                tran.Rollback();
                return false;
                //MessageBox.Show(e.ToString(), "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                conn.Close();
            }

posted on 2010-03-26 15:47  黄聪  阅读(412)  评论(0编辑  收藏  举报