日期:2014-05-20 浏览次数:20917 次
chart1.Series.Clear();提示出错
string str = System.Configuration.ConfigurationManager.ConnectionStrings["login.Properties.Settings.D__健康系统_LOGIN_LOGIN_CMP_MDFConnectionString"].ToString();
string sqlstr = "select 体征填表时间,体温 from TiZheng where 体征填表时间 in( select top 5 体征填表时间 from TiZheng where PatientID= " + patientid + " order by 体征填表时间 desc)";
SqlConnection con = new SqlConnection(str);
SqlDataAdapter da = new SqlDataAdapter(sqlstr, con);
DataSet ds = new DataSet();
da.Fill(ds);
chart1.Series[0].YValueMembers = "体温";
chart1.Series[0].XValueMember = "体征填表时间";
chart1.Series[0].ChartType = SeriesChartType.Line;//设置折线
chart1.DataSource = ds;
chart1.DataBind();