View Single Post
  #1 (permalink)  
Old March 8th, 2015, 08:29 AM
Ronin_PS Ronin_PS is offline
Registered User
Points: 17, Level: 1
Points: 17, Level: 1 Points: 17, Level: 1 Points: 17, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2015
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Chapter 14 - page 503 (Try it out)

Hi,

I need some help with the “Try it out” on Chapter 14 - page 503.
The “using PlanetWroxModel” doesn’t work in All.aspx.cs
The namespace could not be found.

Code:
using PlanetWroxModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Reviews_All : BasePage
{
  protected void Page_Load(object sender, EventArgs e)
  {
    using (PlanetWroxEntities myEntities = new PlanetWroxEntities())
    {
      var authorizedReviews = from review in myEntities.Reviews
                              where review.Authorized == true
                              orderby review.CreateDateTime descending
                              select review;
      GridView1.DataSource = authorizedReviews;
      GridView1.DataBind();
    }
  }
}
- Error:

Code:
Error	1	The type or namespace name 'PlanetWroxModel' could not be found (are you missing a using directive or an assembly reference?)	C:\BegASPNET\Site\Reviews\All.aspx.cs	1	7	Site

Error	2	The type or namespace name 'PlanetWroxEntities' could not be found (are you missing a using directive or an assembly reference?)	C:\BegASPNET\Site\Reviews\All.aspx.cs	13	12	Site
Reply With Quote