GOSSIP GIRL
New Member
i have tried almost everything I could. I have a web app in ASP.net with c#. I am fetching data from the database tables and adding it to dataset. Then I set this dataset as the source to the report. My code is as following.\[code\]con.ConnectionString = ConfigurationManager.ConnectionStrings["familyConnectionString"].ConnectionString; SqlDataAdapter sda = new SqlDataAdapter("select uid, member_name, gender, dob from family where uid='"+uid+"'", con); DataSet1 myds = new DataSet1(); sda.Fill(myds, "family"); SqlDataAdapter sda1 = new SqlDataAdapter("select id from birth_certificates where p_id='"+uid+"'", con); sda1.Fill(myds, "birth_certificates"); ReportDocument rpt = new ReportDocument(); rpt.Load(Server.MapPath("birth_certi_report.rpt")); rpt.Refresh(); rpt.SetDataSource(myds); rpt.SetDatabaseLogon("","",@".\sqlexpress","project2"); CrystalReportViewer1.ReportSource = rpt; CrystalReportViewer1.DataBind(); CrystalReportViewer1.Visible = true; CrystalReportViewer1.RefreshReport();\[/code\]I am using integrated security so I left username and password blank. Please help.
Please Note that the above code is written inside a DropDown_selectedIndexChanged() event. I tried adding it to the page_load but it didn't work.