Expand|Select|Wrap|Line Numbers
- try
- {
- MySqlConnection connection = HopeDB.GetConnection();
- string selectStatement = " SELECT COUNT(benf_id)Id,NAME Disease FROM visit_history JOIN diagnosis ON(visit_history.diagnosis=diagnosis.id) GROUP BY name ";
- MySqlCommand command = new MySqlCommand(selectStatement, connection);
- MySqlDataAdapter adapter = new MySqlDataAdapter();
- DataSet ds = new DataSet();
- DataTable dt = new DataTable();
- dt.TableName = "DataSet1";
- adapter.SelectCommand = command;
- adapter.Fill(dt);
- adapter.Fill(ds);
- reportViewer1.LocalReport.DataSources.Clear();
- ReportDataSource source = new ReportDataSource("DataSet1", dt);
- reportViewer1.LocalReport.DataSources.Add(source);
- this.reportViewer1.RefreshReport();
- }
graph.jpg