Using Entity Framework Data First with ODBC and MySQL

我是研究僧i 提交于 2019-12-11 00:38:58

问题


How can I create a ADO.NET Entity Data Model using an ODBC connection to MySQL?

I installed MySQL 3.51 ODBC driver on my localhost, and I created a test MySQL database. Then using VS2013 I create a data connection using ODBC Data Source to my test database. I can connect and Query that database.

After all those steps before I couldn't created a ADO.NET Entity Data Model using an ODBC connection to MySQL. When I was adding the Data Model I did not have the option of use the ODBC Connection string or the option of creating a new connection string using ODBC datasource


回答1:


You cannot use ODBC with EF you will need to connect to the database and send SQL commads or call store procedures. The only way to use EF is connecting directing to the database use a connection string and valid permissions.



来源:https://stackoverflow.com/questions/25164234/using-entity-framework-data-first-with-odbc-and-mysql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!