首先,我需要通過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