Exemplo n.º 1
0
        /// <summary>
        /// 执行SQL语句事务提交
        /// </summary>
        /// <param name="sqlstr"></param>
        /// <returns></returns>
        public bool ExecuteNonQuery1(string sqlstr)
        {
            bool      flag;
            IDBManage dbManage = DBFactory.CreateDBManage(AppSetting.ConnectionString);

            dbManage.BeginTransaction();
            flag = dbManage.ExecuteNonQuery(sqlstr);
            if (flag)
            {
                dbManage.Commit();
            }
            else
            {
                dbManage.Rollback();
            }
            return(flag);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 执行SQL语句
        /// </summary>
        /// <param name="sqlstr"></param>
        /// <returns></returns>
        public bool ExecuteNonQuery(string sqlstr)
        {
            IDBManage dbManage = DBFactory.CreateDBManage(AppSetting.ConnectionString);

            return(dbManage.ExecuteNonQuery(sqlstr));
        }