首先,我需要通过TextBox
输入创建使用select from database的报表。如何获得文本框的值并生成基于此TextBox
的报表?如果我需要使用多个DataSets
来填充报表中的信息,那么该怎么做?注意:我使用WPF获取TextBoxes
值,Winforms创建reportViewer
。如何在rdlc中使用多个数据集c#report
private void Report_Load(object sender, EventArgs e)
{
DataSet dsr = new DataSet();
_con = new SqlConnection(_strCon);
_adp = new SqlDataAdapter("Select * from tbl_cad",_con);
_adp.Fill(dsr,dsr.Tables[0].TableName);
ReportDataSource rds = new ReportDataSource("tbl_cad",dsr.Tables[0]);
this.reportViewer.LocalReport.DataSources.Clear();
this.reportViewer.LocalReport.DataSources.Add(rds);
this.reportViewer.LocalReport.Refresh();
this.reportViewer.RefreshReport();
}
你能闻到SQL注入?即使基于桌面的WPF应用程序,您也应该始终参数化查询。 – DRapp