title: context.SaveChanges() gives error upon Adding
body: <p>Using this code I get no errors</p>
  
  <pre><code>   public static void kirisekle(string kirisadi, int genislik, int derinlik, int uzunluk, int katid)
      {
          Beam newbeam = new Beam { Kirisadi = kirisadi, Genişlik = genislik, Derinlik = derinlik, Uzunluk = uzunluk, KatID = katid };
          using (pehkEntities context = new pehkEntities())
          {
  
              context.Beams.Add(newbeam);
              context.SaveChanges();
          }
      }
  </code></pre>
  
  <p>However, I get "dbupdateexception was unhandled" error while using this code</p>
  
  <pre><code>public static void dosemeekle(string dosemeadi, int en, int boy, int kalinlik, int katid)
      {
          Slab newslab = new Slab { DosemeAdi = dosemeadi, En = en, Boy = boy, Kalınlık = kalinlik, KatID = katid };
          using (pehkEntities context = new pehkEntities())
          {
  
              context.Slabs.Add(newslab);
              context.SaveChanges();
          }
      }
  </code></pre>
  
  <p>How should I find the reason for this error and fix it?</p>
  
  <p>I am using this code to see the inner exception:</p>
  
  <pre><code>context.Slabs.Add(newslab);
          try
          {
              context.SaveChanges();
          }
          catch( System.Data.Entity.Infrastructure.DbUpdateException ex)
          {
              MessageBox.Show(ex.InnerException.Message);
  
          }
  </code></pre>
  
  <p>However, it shows a messagebox says "an error occured updating the entries. See the inner exception for details." only.</p>