Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Here is my C# code,
C#
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;
                    }
                }
            }
        }
    }

When i run this code, debugger shows error :
"Function evaluation disabled because a previous function evaluation timed out. You must continue execution to reenable function evaluation."

Please help me to get over this.
Thanks in advance.
Posted
Updated 20-Aug-15 3:32am
v2

1 solution

 
Share this answer
 
Comments
Sandy W 20-Aug-15 9:28am    
Thank you for reply,
but solution of this link did not make any difference,
I am still facing the same problem.
Any better suggestions pls..!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900