<% if (Request.QueryString["month"] != null) { string selectedMonth = Request.QueryString["month"]; using (SqlConnection conn = new SqlConnection("yourConnectionString")) { string sql = "SELECT * FROM yourTable WHERE MONTH(dateField) = @month"; SqlCommand cmd = new SqlCommand(sql, conn); cmd.Parameters.AddWithValue("@month", selectedMonth.Split('-')[1]); conn.Open(); SqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { // 处理查询到的数据 } } } %>