Home > Articles > Programming > Windows Programming

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

This chapter is from the book

Updating the Model

081fig01.jpg

Stuff changes. It’s a basic fact of our profession, and you’ve learned to expect and plan for that, right? Right? Well, even if you haven’t, the designers at Microsoft have, and they’ve built the Entity Model Wizard to allow you to be able to update the model when the database schema changes, or when you need to add additional database objects to your model. To see how that works, let’s start by making a minor change to the database:

In the Server Explorer (choose Server Explorer from the Windows menu if it’s not visible), expand the connection to the Recipe database that Visual Studio created for you. Expand the Tables node and then right-click the Recipe table and choose Open Table Definition.

Change the name of the Title field to RecipeName, save the change, and then close the tab.

082fig01.jpg

Let’s make one more change: Select the WeightByUnit table in the Server Explorer and press the Delete key to delete it from the database. Visual Studio will ask you to confirm the change. Click OK.

  • + Share This
  • 🔖 Save To Your Account