title: db.SaveChanges() results in System.Data.Entity.Infrastructure.DbUpdateException' occurred in EntityFramework.dll
body: <p>I am trying to add a Room into my database but keep getting the above error and cannot figure out why.</p>
  
  <p>I am trying to insert:</p>
  
  <p>ID: 12345
  Name: Room</p>
  
  <p>There is no entry in the database with an ID of 12345, in fact there are no entries, I cannot insert anything.</p>
  
  <p><strong>Model</strong></p>
  
  <pre><code>public class Room
  {
      [DatabaseGenerated(DatabaseGeneratedOption.None)]
      public int ID { get; set; }
  
      public string name { get; set; }
  
      public virtual ICollection&lt;RoomItem&gt; RoomItems { get; set; }
      public virtual ICollection&lt;StaffRoom&gt; StaffRooms { get; set; }
      public virtual ICollection&lt;RoomAudit&gt; RoomAudit { get; set; }
  }
  </code></pre>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>[HttpPost]
  [ValidateAntiForgeryToken]
  public ActionResult Create([Bind(Include = "ID, name")] Room room)
  {
  
      db.Rooms.Add(room);
      db.SaveChanges();
      return RedirectToAction("Index");
  
  }
  </code></pre>
  
  <p><strong>Connection String</strong></p>
  
  <pre><code>&lt;connectionStrings&gt;
    &lt;add name="UniversityContext" connectionString="Data Source=(LocalDb)\MSSQLLocalDB;Initial Catalog=RoomAudit;Integrated Security=SSPI;" providerName="System.Data.SqlClient" /&gt;
  &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>I have been trying to figure this out for hours so any help is massively appreciated.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Full error:</p>
  
  <p>An exception of type 'System.Data.Entity.Infrastructure.DbUpdateException' occurred in EntityFramework.dll but was not handled in user code</p>
  
  <p>Additional information: An error occurred while updating the entries. See the inner exception for details.</p>
  
  <p>Inner exception 1:</p>
  
  <p>{"An error occurred while updating the entries. See the inner exception for details."}</p>
  
  <p>Inner exception 2:</p>
  
  <p>{"Cannot insert explicit value for identity column in table 'Room' when IDENTITY_INSERT is set to OFF."}</p>