Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have database with tables as Graduation table with fields as(ID,STDID,Grade,GPA) Student table with fields as(STDID,FName,LName) i want to show a crystal report with specific student number i put on textbox on the windows form, fields as (STDID,FName,LName,Grade,GPA)...

I have made the crystal report and Form with textbox and button. Code on the button as follow:
C#
private void button1_Click(object sender, EventArgs e)
    {
        if (textBox1.Text == "")
        {
            MessageBox.Show("Plese Inter Student's ID");
            textBox1.Focus();
        }
        else
        {
            OpenFileDialog dlg = new OpenFileDialog();
            dlg.Title = "Select Crystal Reports file";
            dlg.Filter = "Crystal Reports (*.rpt)|*.rpt|All Files (*.*)|*.*";
            dlg.InitialDirectory = "D:\\Graduation System\\Graduation System\\graduatedstudents.rpt";
cryRpt.SetParameterValue("STDID");
            CRV1.ReportSource = cryRpt;
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                this.Cursor = Cursors.WaitCursor;
                CRV1.ReportSource = dlg.FileName;
                this.Cursor = Cursors.Default;
            }

        }
    }



the error:
Error 1 No overload for method 'SetParameterValue' takes 1 arguments D:\Graduation System\Graduation System\Form2.cs 26 13 Graduation System
Posted
Updated 10-Apr-15 14:31pm
v3

1 solution

Try this:
cryRpt.SetParameterValue("STDID", textBox1.Text);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900