Alex Rivera | Logout

How to add table in Entity Framework?

Asked 2011-06-24T10:09:50.710
39

I have a project that I made in Asp.net with Entity Framework.

Now I want to add one or more tables in the database and one or more stored procedures. But entities not shows the new table.

How to show this?

Edit
Report

2 Answers

83

Open edmx file, right click anywhere in the modal and select "Update Model from Database" and follow the instructions and choose the desired tables and SPs.

enter image description here

Sometimes even after following these steps, your model will not get updated, close Visual Studio and restart it again. This has happened many times for me.

answered 2011-06-24T11:51:24.317
1

Sharique's answer is the good one. But I noticed a thing: when the Mapping Details window is active(near Error List, Output) and if you are trying to add a new Entity (right click the design surface, Add -> Entity), the popup dialog, "Add Entity" it won't show.

answered 2011-06-25T21:05:39.097

Your Answer