private void init_grid() { string strsql = "select * from book_info"; DataTable dataTable = DBhelp.GetDataTable(strsql); lendbookview.DataSource = dataTable; }
private void Set_chart(Chart chart, string fname, int min, int max) { string sql = "select 数据载入时间," + fname + " from machine_data where Machine_id=1"; string sql2 = "select 数据载入时间," + fname + " from machine_data where Machine_id=2"; string sql3 = "select 数据载入时间," + fname + " from machine_data where Machine_id=3"; DataTable dt = DBhelp.GetDataTable(sql); DataTable dt2 = DBhelp.GetDataTable(sql2); DataTable dt3 = DBhelp.GetDataTable(sql3); chart.Series["风机1"].Points.DataBind(dt.AsEnumerable(), "数据载入时间", fname, ""); chart.Series["风机1"].XValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.DateTime; chart.Series["风机1"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Spline; chart.Series["风机2"].Points.DataBind(dt2.AsEnumerable(), "数据载入时间", fname, ""); chart.Series["风机2"].XValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.DateTime; chart.Series["风机2"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Spline; chart.Series["风机3"].Points.DataBind(dt3.AsEnumerable(), "数据载入时间", fname, ""); chart.Series["风机3"].XValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.DateTime; chart.Series["风机3"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Spline; chart.ChartAreas["ChartArea1"].AxisY.Minimum = min; chart.ChartAreas["ChartArea1"].AxisY.Maximum = max; }
private void init_grid() { string strsql = "select * from reader_info"; DataTable dataTable = DBhelp.GetDataTable(strsql); dataGridView1.DataSource = dataTable; }
public void init_grid() { StringBuilder stringBuilder = new StringBuilder(); string strsql = "select * from lend_list"; stringBuilder.Append(strsql); stringBuilder.Append(" where reader_id='"); stringBuilder.Append(Userhelp.ruid + "'"); stringBuilder.Append(" and state != 0"); DataTable dataTable = DBhelp.GetDataTable(stringBuilder.ToString()); dataGridView1.DataSource = dataTable; }
private void Init_gridview() { dataGridView1.DataSource = DBhelp.GetDataTable("select * from supplier_info"); }