- SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=布线图;User ID=sa;PWD=123");
- string str = "select * from sc";
- SqlDataAdapter sda = new SqlDataAdapter(str, con);
- DataSet ds = new DataSet();
- sda.Fill(ds);
- 代码是没有错误,但是运行结果显示 “尚未数据源dataset1提供数据源实例”,这是什么问题?
- this.reportViewer1.LocalReport.DataSources.Clear();
- this.reportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("ds", ds.Tables[0]));
- this.reportViewer1.RefreshReport();
复制代码 |