[英]Update model From Database | Visual Studio 2019
I need to add a new field in the database model.我需要在数据库模型中添加一个新字段。
I am trying to update a data model in .edmx
file from the database.我正在尝试从数据库更新
.edmx
文件中的数据模型。
Tried:试过:
=> Removing the .edmx
file and adding a new ADO.NET Entity Data Model
containing EF Designer from database
. => 删除
.edmx
文件并EF Designer from database
的新ADO.NET Entity Data Model
。
The wizard then asks for DB details and I checked Database in server explorer and the new field exist and database is connected.然后向导询问数据库详细信息,我在服务器资源管理器中检查了数据库,新字段存在并且数据库已连接。 But still, the wizard closes without asking about the tables.
但是,向导仍然关闭而不询问表。
=> By selecting Update model from database
but it showing me the same problem. => 通过
Update model from database
但它向我展示了同样的问题。 The wizard close after selecting the MySql Database connection and database.选择 MySql 数据库连接和数据库后,向导关闭。
Below is the image of the wizard before it closes automatically.下面是向导在自动关闭之前的图像。
Checked:检查:
Mysql.Data.Entities
Mysql.Data.Entities
Can anyone help me with updating the database model from the database?谁能帮我从数据库更新数据库模型? I have to add a new field in a table and update the models accordingly.
我必须在表中添加一个新字段并相应地更新模型。
I was able to reproduce this error我能够重现此错误
Installed the latest "MySQL for Visual Studio" even though this screen says 2017 and 2019即使此屏幕显示 2017 年和 2019 年,也安装了最新的“MySQL for Visual Studio”
I tried the connector from Oracle's download page and got this我从 Oracle 的下载页面尝试了连接器并得到了这个
With the connector from NuGet, I get your error when the wizard just closes (crashes I guess) without error使用来自 NuGet 的连接器,当向导刚刚关闭(我猜是崩溃)时,我会收到您的错误,而不会出现错误
I'm able to update model from Database in Visual Studio 2019 using these versions:我可以使用以下版本从 Visual Studio 2019 中的数据库更新模型:
MySQL Connector Net 8.0.21
MySQL for Visual Studio 2.0.5
MySQL for Visual Studio installed after MySQL Connector. MySQL for Visual Studio 安装在MySQL Connector 之后。 Tell me if this works for you!
告诉我这是否适合你!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.