title: Database Issue - An error occurred while executing the command definition. See the inner exception for details
body: <p>Trying to populate lists from my database as follows, here is the controller:</p>
  
  <pre><code>namespace TimetableSystem.Controllers
  {
  public class AvailabilityController : Controller
  {
      TimetableSystemEntities systemDB = new TimetableSystemEntities();
  
      public ActionResult Index()
      {
  
          var parkList = new List&lt;String&gt;();
          var parkQry = from p in systemDB.Parks
                        orderby p.ParkID
                        select p.ParkName;
          parkList.AddRange(parkQry);
          ViewBag.Park = parkList;
  </code></pre>
  
  <p>here is the park model:</p>
  
  <pre><code>using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.ComponentModel.DataAnnotations;
  
  namespace TimetableSystem.Models
  {
      public class ParkModel
      {
          [Key]
          public int ParkID { get; set; }
          public string ParkName { get; set; }
      }
  }
  </code></pre>
  
  <p>and here is the TimetableSystemEntities model:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Data.Entity;
  
  namespace TimetableSystem.Models
  {
      public class TimetableSystemEntities : DbContext
      {
          public TimetableSystemEntities() : base("DefaultConnection") { }
  
          public DbSet&lt;Department&gt; Departments { get; set; }
          public DbSet&lt;Module&gt; Modules { get; set; }
          public DbSet&lt;Request&gt; Requests { get; set; }
          public DbSet&lt;Round&gt; Rounds { get; set; }
          public DbSet&lt;User&gt; Users { get; set; }
          public DbSet&lt;ParkModel&gt; Parks { get; set; }
          public DbSet&lt;BuildingModel&gt; Buildings { get; set; }
          public DbSet&lt;RoomModel&gt; Rooms { get; set; }
      }
  }
  </code></pre>
  
  <p>But when I debug and move to the Availability page, I am given this error:</p>
  
  <p>[System.Data.SqlClient.SqlException]
  {"Invalid object name 'dbo.ParkModels'."}</p>
  
  <p>Not sure what is happening here as I can't find 'ParkModels' anywhere in the project or the database, the model is ParkModel, the database table is Park.</p>