Ejemplo n.º 1
0
 /// <summary>
 /// 执行命令返回受影响行数
 /// </summary>
 /// <returns></returns>
 public int ExecNonCmd()
 {
     try
     {
         OpenDb();
         CreateOracleCmd();
         int i = 0;
         i = OracleCmd.ExecuteNonQuery();
         return(i);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message, ex);
     }
     finally
     {
         CloseDb();
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 执行命令返回是否操作成功,执行完不关闭连接
        /// 适用于外部启用事务调用
        /// </summary>
        /// <returns></returns>
        public bool BExecNonCmd()
        {
            bool retBool = false;

            try
            {
                OpenDb();
                CreateOracleCmd();
                int i = 0;
                i       = OracleCmd.ExecuteNonQuery();
                retBool = true;
            }
            catch (Exception ex)
            {
                retBool = false;
                throw new Exception(ex.Message, ex);
            }

            return(retBool);
        }