I have an ADO.NET Entity Data Model created. Everything worked fine, until I added new table in my database. So I wanted to add that table to my data model. I followed these steps: Right click on my model -> Update From Database. Than the wizard opens where I chose what I want to add. When I expand tables tree, my table which I have added to my database is there. I check it and click finish. No errors, everything is successfully done, but there is no any changes on my model. The table is not added to my model. Does anyone know why is this happening?

有帮助吗?

解决方案

When EF complains about certain things (i.e. missing pk) after adding tables to your model trough the "update database" wizard, it does not produce an error or a warning but a message in the error list window. make sure have have checked that. in my case EF was complaining about tables with no primary key defined.

其他提示

Try saving the updated model and then reopening it. I added two tables and although the designer view had a * on it (indicating it was changed), I couldn't see my new tables. On a hunch I closed and reopened the model and the tables were there. This is in VS 2017.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top