2
Answers

I have some doubt

narasiman rao

narasiman rao

12y
1.1k
1

  i done a small application in asp.net with csharp code.

Design As Follows;


Project ID             Dropdown  P00001 to P00010,R00001 to R00010 etc.

Project Cost          Textbox1

Project Name         Textbox2

for this i done insert command and records are saved in database.

my Question is in design page i have one textbox and one button,and button name is Projectwisecost.

Textbox3    Projectwisecost(Button Name) .

in textbox3 when i type   P00001 that projectcost,name should be displayed.
suppose when i type      R00001  that projectcost,name should be displayed. 



For the above you send the answer as follows;
private void btnshow_Click(System.Object sender, System.EventArgs e)
{
    con.Open();
    string str = "select * from student where sid='" + TextBox1.Text + "'";
    SqlCommand com = new SqlCommand(str, con);
    SqlDataAdapter sqlda = new SqlDataAdapter(com);
    DataSet ds = new DataSet();
    sqlda.Fill(ds, "student");
    con.Close();
    r1.SetDataSource(ds);
    CrystalReportViewer1.ReportSource = r1;
    CrystalReportViewer1.RefreshReport();
    CrystalReportViewer1.Refresh();

} 


from this code i have some doubt.in the above code what is meant for r1.



please help me.



Answers (2)