Example #1
0
 public SqlDataReader  GetList(int PageSize, int PageIndex, string tableName, string key, string strWhere, string Fields, string SortStr, bool IsRetCount)
 {
     SqlParameter[] parameters =
     {
         new SqlParameter("@TableName",  SqlDbType.VarChar,  500),
         new SqlParameter("@Fields",     SqlDbType.VarChar,  255),
         new SqlParameter("@SortStr",    SqlDbType.VarChar,  255),
         new SqlParameter("@Pkey",       SqlDbType.VarChar,  255),
         new SqlParameter("@PageSize",   SqlDbType.Int),
         new SqlParameter("@PageIndex",  SqlDbType.Int),
         new SqlParameter("@IsRetCount", SqlDbType.Bit),
         new SqlParameter("@WhereStr",   SqlDbType.VarChar, 3000),
     };
     parameters[0].Value = tableName;
     parameters[1].Value = Fields;
     parameters[2].Value = SortStr;
     parameters[3].Value = key;
     parameters[4].Value = PageSize;
     parameters[5].Value = PageIndex;
     parameters[6].Value = IsRetCount;
     parameters[7].Value = strWhere;
     return(MySQLHelper.ExecuteReader(SqlConnString, MySQLHelper.CreateCommand(CommandType.StoredProcedure, "UP_GetRecordByPageOrder", parameters)));
 }
Example #2
0
        public string GetJSONInfo(string sql)
        {
            var reader = MySQLHelper.ExecuteReader(SqlConnString, MySQLHelper.CreateCommand(sql));

            return(JSONHelper.ToJson(JSONHelper.DbReaderToHash(reader)));
        }