protected void Button1_Click(object sender, EventArgs e) { public OleDbConnection conn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Currently_Working\Chequedatabase.mdb;Persist Security Info=False"); conn.Open(); OleDbDataAdapter da = new OleDbDataAdapter("select * from tbl_cheque_data;", conn); DataSet ds = new DataSet(); da.Fill(ds, "tbl_cheque_data"); ReportDocument myReport = new ReportDocument(); myReport.Load(Server.MapPath("Cr_online_cheque.rpt")); myReport.SetDataSource(ds.Tables[0]);///Take index in [] for C# this.CrystalReportViewer1.Visible = true; foreach (CrystalDecisions.CrystalReports.Engine.Table myTable in myReport.Database.Tables) { myLogin = myTable.LogOnInfo; myLogin.ConnectionInfo.ServerName = "param"; //name of PC myLogin.ConnectionInfo.DatabaseName = "Chequedatabase.mdb"; //name of Database myLogin.ConnectionInfo.Password = ""; myLogin.ConnectionInfo.UserID = ""; myTable.ApplyLogOnInfo(myLogin); } CrystalReportViewer1.ReportSource = myReport; CrystalReportViewer1.DataBind(); conn.Close(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)