如何解决这个问题?我是ASP.Net的新手 这是我的代码:
try
{
cmd.Connection = con;
if (cmd.Connection.State == ConnectionState.Open)
{
cmd.Connection.Close();
}
else
{
con.Open();
}
cmd.CommandText = "SELECT " + Dd_List.SelectedValue.ToString() + "," + Dd_ListY.SelectedValue.ToString() + " FROM " + DropDownList3.SelectedValue.ToString() + " WHERE " + dd_equal_to_First_Cond.SelectedValue.ToString() + " BETWEEN '" + txtDateFrom.Text.ToString() + "' AND '" + txtDateTo.Text.ToString() + "' ";
Response.Write(cmd.CommandText);
da.SelectCommand = cmd;
da.Fill(ds);
Chart1.DataSource = ds;
Chart1.Legends.Add("Inspection_Date").Title = "Inspection_Date";
Chart1.ChartAreas["ChartArea1"].AxisX.Title = Dd_List.SelectedValue;
Chart1.ChartAreas["ChartArea1"].AxisY.Title = Dd_ListY.SelectedValue;
Chart1.Series["Series1"].XValueMember = Dd_List.SelectedValue;
Chart1.Series["Series1"].YValueMembers = Dd_ListY.SelectedValue;
Chart1.DataBind();
}