这样还是不行啊
会不会还是那个查询语句哪里错了啊
protected void Button2_Click(object sender, EventArgs e)
{
SqlConnection meteor = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["meteor"]);
meteor.Open();
DataSet ds1 = new DataSet();
SqlDataAdapter sda = new SqlDataAdapter("select studentname,year
from studentinformation
where year >=" + DropDownList1.SelectedValue + "-" + DropDownList2.SelectedValue + "-" + "01" + "and year < " + DropDownList1.SelectedValue + "-" + (Convert.ToInt32(DropDownList2.SelectedValue) + 1).ToString() + "-" + "01", meteor);
sda.Fill(ds1, "yearmonth2");
GridView1.DataSource = ds1.Tables["yearmonth1"];
GridView1.DataBind();
meteor.Close();
}