使用实体框架数据首先与ODBC和MySQL [英] Using Entity Framework Data First with ODBC and MySQL

查看:124
本文介绍了使用实体框架数据首先与ODBC和MySQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何使用ODBC连接到MySQL创建一个 ADO.NET实体数据模型

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

我将MySQL 3.51 ODBC驱动程序安装在我的本地主机,我创建了一个测试MySQL数据库。然后使用VS2013我使用ODBC数据源创建一个数据连接到我的测试数据库。我可以连接并查询该数据库。

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.

在使用ODBC连接到MySQL之前,无法创建一个 ADO.NET实体数据模型之后的所有步骤。当我添加数据模型时,我没有选择使用ODBC连接字符串或使用ODBC数据源创建新的连接字符串的选项

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

推荐答案

您不能使用ODBC与EF,您将需要连接到数据库并发送SQL通话或调用存储过程。使用EF的唯一方式是连接指向数据库使用连接字符串和有效权限。

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.

这篇关于使用实体框架数据首先与ODBC和MySQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆