title: Entity Framework insert doesn't work
body: <p>I have a very simple windows form project with Entity Framework.</p>
  
  <p>Simply I draged my tables from "Data Source" tab in my "form" and it generate for me a "DataGridView" and a "BindingSource".</p>
  
  <p>Data bound successfully and when I run project I can see "DataGridView" filled with data correctly and I can update any cells value from "DataGridView".</p>
  
  <p>Problem is I can not insert any rows in my "DataGridView".</p>
  
  <p>Here is some codes that I wrote hope it be useful to solve problem:</p>
  
  <pre><code>    Teachers_DBEntities context = new Teachers_DBEntities();
  
      private void SaveItem_Click(object sender, EventArgs e)
      {
          context.SaveChanges();
          MessageBox.Show("saved successfully");
      }
  
      private void Form1_Load(object sender, EventArgs e)
      {
          teachers_tableBindingSource.DataSource = context.teachers_table.ToList();
      }
  </code></pre>
  
  <p><strong>Upates for comments</strong></p>
  
  <p>I tested my "BindingSource" and found that it successfully understand if new record insert in "DataGridVeiw", but changes won't apply in database when I call <code>context.savechanges();</code></p>
  
  <p><code>context.savechanges()</code> works fine when I update a cell, but it doesn't work when I try to insert a new record in my "DataGridView".</p>
  
  <p>In my edmx file I mapped all columns correctly and primary key <code>StoreGeneretedPattern</code> property is set to <code>Identity</code> and its <code>Entity Key</code> property is set to <code>true</code>. Its <code>auto-increment</code> property in my SQL Server database file is set to <code>true</code>.</p>
  
  <p>any help is appreciated.</p>