views:

22

answers:

1

Hi,

I am using Entity Framework 4.

I have my model file with my tables on it. If I go and add a new column to one of my tables (in SQL Server) how do I update the table in the model without having to go and delete and re-adding it to the model?

Thanks

+1  A: 

There is an option when you right click anywhere in the model (*.edmx): Update Model From Database...
Then a wizard will look for any differences (Add / Refresh / Delete). So if you need to update a table, go to the Refresh tab and select your table.

Mind you, this is only possible in an Entity Framework model, not in a LinqToSql model.

Roel
@Roel: Thanks. I didn't see the refresh tab on update model from database option.
Brendan Vogt
glad to help :-) Any chance of accepting my answer? ;-)
Roel
@Roel: I just did, it told me to wait a couple of minutes before I could accept it.
Brendan Vogt
@Brendan Vogt: No problem, I just remembered that too. Thanks!
Roel