当前位置:Gxlcms > 数据库问题 > EF连接Mysql 表'TableDetails'中的列'IsPrimaryKey'的值为DBNull

EF连接Mysql 表'TableDetails'中的列'IsPrimaryKey'的值为DBNull

时间:2021-07-01 10:21:17 帮助过:26人阅读

---> System.InvalidCastException:指定的转换无效。

原文链接http://stackoverflow.com/questions/33575109/mysql-entity-the-value-for-column-isprimarykey-in-table-tabledetails-is

 原文:

Entity Framework (version 6.1.3) and MySQL Server (>= 5.7.6)

One way to resolve the issue is,

1. Open Services (services.msc) and restart MySQL57 service.   
2. Execute the following commands in MySQL.
   use <<database name>>;
   set global optimizer_switch=‘derived_merge=OFF‘;
3. Update the .edmx.

It‘s a late reply. But hope it will help somebody.

Thanks.

 大致翻译:

1.重新启动mysql服务

2.打开命令列界面

set global optimizer_switch=‘derived_merge=OFF‘;

3.重新新建EF

 

EF连接Mysql 表'TableDetails'中的列'IsPrimaryKey'的值为DBNull

标签:switch   ast   服务   生成   rest   null   stack   无法   overflow   

人气教程排行