This my code:
SqlDataAdapter adp = new SqlDataAdapter("Report",con);
adp.SelectCommand = new SqlCommand();
adp.SelectCommand.CommandType = CommandType.StoredProcedure;
DataSet set = new DataSet();
DataTable dtbl = new DataTable("DataTable1");
adp.SelectCommand.Parameters.AddWithValue("@clrk_Name", txtNameReport.Text);
adp.SelectCommand.Parameters.AddWithValue("@clrk_Family",txtFamilyReport.Text);
adp.SelectCommand.Parameters.AddWithValue("@clrk_MelliCode",txtMelliCodeReport.Text);
adp.SelectCommand.Parameters.AddWithValue("@AzTarikh",txtMelliCodeReport.Text);
adp.SelectCommand.Parameters.AddWithValue("@Ela", txtElaReport.Text);
adp.Fill(set, "DataTable1");
ReportDataSource source = new ReportDataSource("DataTable1",set);
reportViewer1.Visible = true;
reportViewer1.LocalReport.ReportPath = "Report1.rdlc";
reportViewer1.LocalReport.DataSources.Clear();
reportViewer1.LocalReport.DataSources.Add(source);
reportViewer1.LocalReport.Refresh();
When i run my project i get this error:
Error 1 The tablix 'Tablix2' is in the report body but the report has no dataset. Data regions are not allowed in reports without datasets. D:\Project\evaluation\WindowsFormsApplication1\WindowsFormsApplication1\Report1.rdlc WindowsFormsApplication1
I can't work with XML
Replies
Know the answer? Post it — somebody with the same question will find it here.