예제 #1
0
        /// <summary>
        /// 制作参数
        /// </summary>
        /// <param name="targetFiled"></param>
        /// <param name="targetValue"></param>
        /// <returns></returns>
        public static IDbDataParameter MakeParameter(string targetFiled, object targetValue)
        {
            var dbHelper = DbHelperFactory.Create(CurrentDbType, ConnectionString);

            return(dbHelper.MakeParameter(targetFiled, targetValue));
        }
예제 #2
0
        /// <summary>
        /// 执行查询返回DataReader
        /// </summary>
        /// <param name="connectionString">数据库连接</param>
        /// <param name="commandType">命令分类</param>
        /// <param name="commandText">sql查询</param>
        /// <param name="dbParameters">参数集</param>
        /// <returns>结果集流</returns>
        public static IDataReader ExecuteReader(string connectionString, string commandText, IDbDataParameter[] dbParameters = null, CommandType commandType = CommandType.Text)
        {
            var dbHelper = DbHelperFactory.Create(CurrentDbType, connectionString);

            return(dbHelper.ExecuteReader(commandText, dbParameters, commandType));
        }