Home > Articles > Programming > Windows Programming

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

Update the Model


Have you thought about what you expect to happen? Let’s try it out and see if you were right:


In the Entity Model Designer, right-click on a blank area of the design surface and choose Update Model from Database...

The wizard will open on a screen with three tabs, and the Add tab will be displayed. You can use this tab to add database objects to your model after it has been created.

We’ll do that in the next section of this chapter, but not right now, so select the Refresh tab.

You can’t make changes on the Refresh tab. Visual Studio is going to update every object that has changed in the database (assuming that you’ve already included the object in the model).

Are you surprised at the number of tables to be updated, even though we only updated one? That’s because of the way all the tables are related. When we made a change to the Recipe table, Visual Studio decided that every table that’s related (directly or indirectly) to it needs to be updated.

You can’t make changes on the Delete tab either, but the IngredientWeights table that we deleted from the database is listed here.

Click Finish to exit the wizard and update the model.

  • + Share This
  • 🔖 Save To Your Account