Tank50 2 Junior Poster

HI
I am developing web site in ASP.net and crystal reports,this is first time i using asp.net and crystal reports.Still ia writing test coing to do this.i mention what is problem is.what i did is first I created crystal report viewer and crystal report.After I drag crystal report i select what are the firld I want to the dispaly(I did that using Field Explore).i metnion what is code I used

protected void Button1_Click(object sender, EventArgs e)

{SqlConnection con = new SqlConnection("Data Source=IT-UDARA;Initial Catalog=Test;Integrated Security=True");string str = "select * from dbo.Executive where ExecutiveCode='115'";
SqlCommand command = new SqlCommand(str, con);
SqlDataAdapter adapter=new SqlDataAdapter(command);
DataSet Da = new DataSet();
adapter.Fill(Da);
ReportDocument doc = new ReportDocument();
doc.Load(Server.MapPath("Test.rpt"));
doc.SetDataSource(Da);
//Console.WriteLine(Da.Tables[0].Rows.Count.ToString());
CrystalReportViewer1.ReportSource = doc;
CrystalReportViewer1.DataBind();
CrystalReportViewer1.RefreshReport();
}

I want To display only specific record only,but once I start the web site.I contains the all the data in that dbo.Executive table,but once I click on button,it never change.Pls help me to slove this problem


Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.