如何让vs2017 EF实体生成支持Mysql 和 Oracle?

1.Mysql

安装   MySql Connector/Net        https://dev.mysql.com/downloads/connector/net/

安装    mysql for visualstudio         https://dev.mysql.com/downloads/windows/visualstudio/

安装时entity framwork相关的选项一定要选。

 

如果还不行的话执行一下 .\devenv.exe /setup

项目中 添加最新版本MySql.Data 、MySql.Data.Enity包。

 ----问题处理

 'System.Data.StrongTypingException: The value for column 'IsPrimaryKey' in table 'TableDetails' is DBNull . ---> System.InvalidCastException: Specified cast is not valid.

 --- 

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.

2.Oracle

安装ODTWithODAC

如果需要,安装odt for vs2017

---问题处理

 --vs2017闪退  

     用oui卸载安装的相关oracle文件及目录

posted @ 2017-11-29 12:39  darkblue  阅读(419)  评论(0编辑  收藏  举报