Exemplo n.º 1
0
        public static object GetScalarValue(CommandType cmdType, string cmdText, DbParameter[] dbParam)
        {
            SqlParameter[] spParam  = ConvertToSqlParameter(dbParam);
            object         objValue = SqlHelper.ExecuteScalar(sqlConnectionstring, cmdType, cmdText, spParam);

            DbParameter.SetDbParameterValueFromSql(spParam, dbParam);
            return(objValue);
        }
Exemplo n.º 2
0
        public static SqlDataReader GetDataReader(CommandType cmdType, string cmdText, DbParameter[] dbParam)
        {
            SqlParameter[] spParam = ConvertToSqlParameter(dbParam);
            SqlDataReader  dReader = SqlHelper.ExecuteReader(sqlConnectionstring, cmdType, cmdText, spParam);

            DbParameter.SetDbParameterValueFromSql(spParam, dbParam);
            return(dReader);
        }
Exemplo n.º 3
0
        public static DataTable GetDataTable(CommandType cmdType, string cmdText, DbParameter[] dbParam)
        {
            SqlParameter[] spParam   = ConvertToSqlParameter(dbParam);
            DataTable      dtblTable = SqlHelper.ExecuteDataTable(sqlConnectionstring, cmdType, cmdText, spParam);

            DbParameter.SetDbParameterValueFromSql(spParam, dbParam);
            return(dtblTable);
        }
Exemplo n.º 4
0
 public static void ExecuteNonQuery(CommandType cmdType, string cmdText, DbParameter[] dbParam)
 {
     SqlParameter[] spParam = ConvertToSqlParameter(dbParam);
     SqlHelper.ExecuteNonQuery(sqlConnectionstring, cmdType, cmdText, spParam);
     DbParameter.SetDbParameterValueFromSql(spParam, dbParam);
 }