string constr = "Data Source=BITS;Initial Catalog=TEST_DB;User ID=sa;Password=123456"; SqlConnection sqlcon = new SqlConnection(constr); string query; query = "SELECT * FROM t_Student"; sqlcon.Open(); SqlDataAdapter da = new SqlDataAdapter(query, constr); DataSet ds = new DataSet(); da.Fill(ds, "t_Student"); Microsoft.Reporting.WinForms.ReportDataSource reportDataSource = new Microsoft.Reporting.WinForms.ReportDataSource(); reportDataSource.Name = "StudentListView"; reportDataSource.Value = "StudentListView.rpt"; reportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("ds_t_Student", ds.Tables[0])); reportViewer1.LocalReport.DataSources.Add(reportDataSource); reportViewer1.LocalReport.ReportPath = "StudentListView.rpt"; sqlcon.Close();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)