text: Answered by:
  Editing the .edmx file causes my objectcontext to stop working
  Question
  Hi
  I'm having trouble when I edit my .edmx file in my C# desktop app. I'm currently trying to teach myself to make a Windows Forms app in Windows 8.1.
  I'm not sure if objectcontext is the right word but that's what I got from a tutorial. Anyway, things were working file until after I updated my .edmx file after I made changes to my SQLServer 2014 Express database (I added a column to one of the tables). I'm using Visual Studio 2013 Express. I've got the following code:
  using System;
  using System.Collections.Generic;
  using System.Collections;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Windows.Forms;
  using System.IO;
  using System.Data.SqlClient;
  using System.ComponentModel;
  using System.Data.Entity;
  using System.Data.Entity.Validation;
  using System.Data.Linq;
  using System.Configuration;
  using System.Data;
  // Create objectcontext object
  myAppEntities db = new myAppEntities();
  The above "myAppEntities db = new myAppEntities();" line stops working after I update the .edmx file. I get a red line under the second myAppentities(). I'm getting the name myAppEntities from the name of the connection string in app.config I've got 3 other connection strings still in app.config as a result of my still learning how to program in C#.
  I tried updating the .edmx file by right clicking on it and then clicking on "Update model from database...". That's what caused my problem, i.e. when the second myAppEntities(); in that line got the red line under it.
  I've restored my project from a backup so the red line is gone now. I just need to know how to update my .edmx file in a way that it doesn't upset my objectcontext creation. Should I just delete the .edmx file and start from scratch? Or is there something else I am doing wrong?
  I did find this link on stackoverflow but I'm not confident about trying what's said there:
  Thanks.