views:

13

answers:

2

I tried rebuilding but it seems that the edmx file doesn't update itself with the changes I made. Any suggestions besides removing the edmx and remaking it?

A: 

You can add the field manually. It's not so hard, especially if it's a scalar.

  1. Make sure your existing model is checked in in case you have to roll back!
  2. Note the name of some other scalar column in the table, preferably one with a unique name and the same type.
  3. Right click model, "Open With", XML Editor.
  4. Search for the other field.
  5. Add the new field everywhere the other field pops up. There will be at least three different places to change. But note that the field may already be in the SSDL/storage schema, which would be why it didn't add in the first place.
  6. Look at the Errors pane to make sure you haven't messed up the XML validity.
  7. Save and compile.

Now you can edit the new field in the GUI by re-opening the model, if need be.

Craig Stuntz
+1  A: 

If you are using Entity Framework 4.0 you can just right-click the white-space in the designer, choose 'Update Model from Database' and hit Finish. This will refresh all tables.

Rune
Fantastic thanks!
Serg