Click here to Skip to main content
15,905,028 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I have written the following code but it gives the error:

the type or namespace IAPEntities could not be found.


C#
protected void btngenerate_Click(object sender, EventArgs e)
        {
            ReportDocument report = new ReportDocument();
            report.Load(Server.MapPath("CrystalReport1.rpt"));

            using (IAPEntities db = new IAPEntities())
            {
                report.SetDataSource(from u in db.attendance1 select new { u.type, u.present, u.absent, u.working, u.month});
            }

            CrystalReportViewer1.ReportSource = report;
        }


Please help me in this.

Thanks in Advance.
Posted
Updated 7-Jun-11 21:09pm
v3

There is not much to go on, but generally you or forgot to put a using on top or forgot to reference an assembly. Check to what namespace the IAPEntities belongs and make sure you referenced the assembly (even if it is another project in the same solution) and you use the correct using statement.

hope this helps
 
Share this answer
 
Make sure that you are importing the namespace into your project by having a using statement at the top of the code file that contains the type reference.
 
Share this answer
 

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