foreach (string key in Request.QueryString.AllKeys) { sql = sql + "' and " + key + "='" + Request.QueryString[key].ToString() + "' ORDER BY enter_time desc"; }