protected void Viewbutton_Click(object sender, EventArgs e) { string path = Server.MapPath(@"CrystalReport.rpt"); SqlConnection con = new SqlConnection("Data Source=HOME-PC\\SQLEXPRESS;Initial Catalog=test1;Persist Security Info=True;User ID=user1;Password=user1"); con.Open(); SqlCommand cmd = new SqlCommand(); cmd = new SqlCommand("select * EMaster", con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds, "Infotable"); ReportDocument rep = new ReportDocument(); rep.Load((path)); CrystalReportViewer1.RefreshReport(); rep.SetDataSource(ds.Tables["Infotable"]); //rep.SetDataSource(ds.Tables[0]); CrystalReportViewer1.ReportSource = rep; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)