我有一个场景,我需要DataTable使用Dapper从查询返回一个.如何DataTable使用Dapper从查询中返回a ?
DataTable dt = connection.Query("SELECT * FROM table");
Run Code Online (Sandbox Code Playgroud) 我正在ReportDataSource使用Dapper进行查询.但是,即使有IEnumerable加载的数据,我也有一个空报告.当你花一件Datatable作品.
如何使用Dapper从查询传递数据ReportViewer?
this.reportViewer.LocalReport.DataSources.Clear();
DataTable dt = new DataTable();
dt = CN.Query(Sql, param);
Microsoft.Reporting.WinForms.ReportDataSource rprtDTSource = new Microsoft.Reporting.WinForms.ReportDataSource(dt.TableName, dt);
this.reportViewer.LocalReport.DataSources.Add(rprtDTSource);
this.reportViewer.RefreshReport(); –
Run Code Online (Sandbox Code Playgroud)