Farna Farna - 1 year ago 101
C# Question

Reporting of VS 2010 and my issues

I make a WinForms app and I use ReportViewer on my form and I design a report (

) for it. In my report I select my table and stored procedure and I define the parameter for my stored procedure, and in form load event of my form I write :

private void Form1_Load(object sender, EventArgs e)
// TODO: This line of code loads data into the 'testoDataSet.Table2' table. You can move, or remove it, as needed.

ReportParameter pa = new ReportParameter("Name", "abc");
ReportParameter pa1 = new ReportParameter("Family", "xyz");

reportViewer1.LocalReport.SetParameters(new ReportParameter[] { pa, pa1 });


but when I run my app all records showed on my report viewer but my select query is:

select *
from User
where Name = 'abc' and Family = 'xyz';

What is wrong??

Answer Source

it solved:

this.Table2TableAdapter.FillByNameAndFamily(this.testoDataSet.Table2, "abc", "xyz");
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download