Esempio n. 1
0
        /// <summary>
        /// 执行查询语句,返回OracleDataReader
        /// </summary>
        /// <param name="cmdType">命令类型</param>
        /// <param name="cmdText">查询语句</param>
        /// <param name="objParams">查询语句参数</param>
        /// <returns>返回结果</returns>
        public static DbDataReader ExecuteReader(CommandType cmdType, string cmdText, params ObjectParameter[] objParams)
        {
            DbDataReader drResult = null;

            switch (DbType.ToLower())
            {
            case "oracle":
                drResult = OracleDbHelper.ExecuteReader(DbConnectionString, cmdType, FormatCommandText(cmdText), ObjectParamterToOracleParameter(objParams));
                break;

            case "sql":
                drResult = SqlDbHelper.ExecuteReader(DbConnectionString, cmdType, FormatCommandText(cmdText), ObjectParamterToSqlParameter(objParams));
                break;
            }
            return(drResult);
        }
Esempio n. 2
0
        /// <summary>
        /// 执行查询语句,返回OracleDataReader
        /// </summary>
        /// <param name="cmdType">命令类型</param>
        /// <param name="cmdText">查询语句</param>
        /// <returns>返回结果</returns>
        public static DbDataReader ExecuteReader(CommandType cmdType, string cmdText)
        {
            DbDataReader drResult = null;

            switch (DbType.ToLower())
            {
            case "oracle":
                drResult = OracleDbHelper.ExecuteReader(DbConnectionString, cmdType, cmdText);
                break;

            case "sql":
                drResult = SqlDbHelper.ExecuteReader(DbConnectionString, cmdType, cmdText);
                break;
            }
            return(drResult);
        }