protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { ReportDocument crystalReport = new ReportDocument(); crystalReport.Load(Server.MapPath("~\\CrystalReport.rpt")); DataTable dt = new DataTable(); dt = GetData(); crystalReport.SetDataSource(dt); //error occurs on this line CrystalReportViewer1.ReportSource = crystalReport; CrystalReportViewer1.DataBind(); } catch (Exception ex) { Response.Write(ex); } } } private DataTable GetData() { string constr = ConfigurationManager.ConnectionStrings["DBCarUAE"].ConnectionString; using (SqlConnection con = new SqlConnection(constr)) { using (SqlCommand cmd = new SqlCommand("SELECT F_Name, L_Name,E_Mail from VendorRegistration")) { using (SqlDataAdapter sda = new SqlDataAdapter()) { cmd.Connection = con; sda.SelectCommand = cmd; cmd.CommandTimeout = 0; using (DataTable dsCustomers = new DataTable()) { sda.Fill(dsCustomers); return dsCustomers; } } } } }
Function evaluation disabled because a previous function evaluation timed out. You must continue execution to reenable function evaluation.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)