title: An error related to Entity Framework, .NET4, MVC3
body: <p>I am new to this platform. So, I'm not familier with all the terminologies.<br>
  I'm getting the error message :</p>
  
  <blockquote>
    <p>A specified Include path is not valid. The EntityType 'ERP.Models.OpeningBalance' does not declare a navigation property with the name 'AccountHeadId'.</p>
  </blockquote>
  
  <p>Here I got a Model class 'OpeningBalance' in the project 'ERP'  </p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.ComponentModel.DataAnnotations;
  
  namespace ERP.Models.Account
  {
      public class OpeningBalance
      {
  
          [Key]
          public int OpenningBalanceId { get; set; }
  
          [Required(ErrorMessage = "The {0} cannot be left blank.")]
          [Display(Name = "Openning Balance Date")]
          [DataType(DataType.Date)]
          [DisplayFormat(NullDisplayText = "", DataFormatString = "{0:dd-MM-yyyy}")]
          public DateTime OpenningBalanceDate { get; set; }
  
          [Required]
          [StringLength(100, ErrorMessage = "The {0} cannot be left blank.")]
          [Display(Name = "AccountHeadId")]
          public int AccountHeadId { get; set; }
          public virtual ChartOfAccount ChartOfAccount { get; set; }
  
  
      }
  }
  </code></pre>
  
  <p>Isn't the <code>public int AccountHeadId { get; set; }</code> is </p>
  
  <blockquote>
    <p>a navigation property with the name 'AccountHeadId'</p>
  </blockquote>
  
  <p>?<br>
  The Source Error shows the lines from <b>Controller</b> :  </p>
  
  <pre><code>    var openingBalances = db.OpeningBalances.Include(o =&gt; o.AccountHeadId);
      return View(openingBalances.ToList());  
  </code></pre>
  
  <p>I searched a lot in web including all related ques in stackoverflow, then tried the following form:</p>
  
  <pre><code>var openingBalances = from o in db.OpeningBalances.Include(o=&gt;o.AccountHeadId) select o;  
  return View(openingBalances.ToList());
  </code></pre>
  
  <p>That didn't work too. Anybody have any idea?</p>