title: Unable to Insert data in an .mdf using Entity Framework
body: <p>I am trying to insert Data in an .mdf file using Entity Framework but there is no data saved in the database. (I am using VS 2013)</p>
  
  <p>Code Against the Button is </p>
  
  <pre><code>private void BtnSubmit_Click(object sender, RoutedEventArgs e)
      {
          Product record = new Product();
          record.ProductName = txtProductName.Text;
          AzadIndustryEntities1 Db = new AzadIndustryEntities1();
          Db.Products.Add(record);
          Db.SaveChanges();
          MessageBox.Show("Record Inserted");
      }
  </code></pre>
  
  <p>SQL against Products Table is </p>
  
  <pre><code>CREATE TABLE [dbo].[Products] (
  [ProductID]          INT          IDENTITY (1, 1) NOT NULL,
  [ProductName]        VARCHAR (50) NULL,
  [ProductQuantity]    INT          NULL,
  [PricePerUnit]       VARCHAR (50) NULL,
  [ProductDescription] VARCHAR (50) NULL,
  [UserID]             INT          NULL,
  [CustomerID]         INT          NULL,
  CONSTRAINT [PK_Products] PRIMARY KEY CLUSTERED ([ProductID] ASC),
  CONSTRAINT [FK_Products_ToTable_Customer] FOREIGN KEY ([CustomerID]) REFERENCES [dbo].[Customer] ([CustomerID]),
  CONSTRAINT [FK_Products_ToTable_Products] FOREIGN KEY ([UserID]) REFERENCES [dbo].[Users] ([UserID])
  </code></pre>
  
  <p>);</p>