Refresh model from database does not add new table from database

I have created an Entity Data ADO.NET data model. Everything worked fine until I added a new table to my database. Therefore, I wanted to add this table to my data model. I followed these steps: Right click on my model -> Update from database. How the wizard opens, where I chose what I want to add. When I expand the table tree, my table, which I added to my database, is. I check it and click. There are no errors, everything has been done successfully, but there are no changes in my model. The table is not added to my model. Does anyone know why this is happening?

+4
source share
2 answers

When EF complains about some things (that is, pk is missing) after adding tables to your model through the "update database" wizard, it does not give an error message or warning, but a message appears in the error list window. be sure to check it out. in my case, EF complained about tables without specifying a primary key.

+6
source

Try to save the updated model and then open it again. I added two tables, and although the constructor view had * on it (indicating its change), I could not see my new tables. On suspicion, I closed and reopened the model, and there were tables. This is in VS 2017.

0
source

Source: https://habr.com/ru/post/1532282/


All Articles