I generated an .edmx file from database.
I want to know if I make changes to my database schema then how will those changes be reflected in my Entity Data Model Designer diagram? I made changes to my database schema but found the changes did not appear in my Entity Data Model Designer diagram. Can someone explain to me how to propagate database schema changes to my Entity Data Model Designer diagram?
I think what you are asking is if you change your schema, how is this then updated in your EDMX file?
- Open your EDMX file in Visual Studio
- Right click on the design surface
- Select 'Update Model from Database'
- Follow the wizard to 'Refresh' your
model.
Your changes should now be visible on the design surface in the respective containers.
so i want to know if i add or remove
any field from table then how change
will be reflected in my Entity Data
Model Designer where diagram show.
Additions in your tables will be reflected in your model if you "Update Model From Database" as posted in the other answers. If you delete tables or columns though in my experience you have to remove the corresponding entity manually from your model and then update the model from the database.
Right click in the edmx, click "Update Model From Database". Go over to the "Refresh" tab, and click "Finish".
You need to open up your model and right click on an empty space and select Update Model from Database...
When using 'Update from Database' you can also select whether to add new tables from your database if required, or leave them out.