根据MySQL官方说明,这两个版本相互是没有问题的:http://dev.mysql.com/doc/connector-net/en/connector-net-versions.html
2、利用NuGet安装了EntityFramework和MySql.Data、MySql.Data.Entity包:
3、修改以后查看Web.config文件:
上述步骤都完成后,重启visual studio(及电脑)后,依旧无法在vs中选择连接到mysql的数据源:
替换方法:(待验证)
不必用服务器资源管理器,自己在配置文件中写连接字符串。
<connectionStrings>
<add name="MySqlConnectionString" connectionString="Server=localhostDatabase=testUid=rootPwd=12345678"/>
</connectionStrings>
跟一般的mssql不同只是驱动不同而已。首先需要安装.net连接mysql的驱动,去
http://www.mysql.com/downloads/connector/net/
下载并安装。
然后你就可以在vs的server explorer添加连接了。
在程序中你也可以用连接字符串,比如:
<add name="mySql" connectionString="Server=localhostDatabase=mydbUid=UserPwd=mypass" providerName="MySql.Data.MySqlClient"/>
如果要具体教程的话可以看一下
http://www.itcsolutions.eu/2010/09/09/how-to-connect-to-mysql-database-from-visual-studio-vs2010-problems-with-net-connectors/
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)