【发布时间】:2011-05-01 22:17:32
【问题描述】:
我正在尝试在 vs2010 中使用 c# 连接到 mysql。我从 mysql 站点安装了 .net 连接器的 6.3.5 版本。我尝试使用以下连接字符串 -
<add name="mySql" connectionString="Server=localhost;Database=mydb;Uid=User;Pwd=mypass;" providerName="System.Data.OleDb.OleDbConnection, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
我收到以下错误 -
An OLE DB Provider was not specified in the ConnectionString. An example would be, 'Provider=SQLOLEDB;'.
然后我将连接字符串更改为 -
<add name="mySqlTarget" connectionString="Provider=MySQLProv;Server=localhost;Database=mydb;Uid=User;Pwd=mypass;" providerName="System.Data.OleDb.OleDbConnection, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
并得到以下错误 -
The 'MySQLProv' provider is not registered on the local machine.
有人知道为什么会这样吗?
感谢您的任何想法。
【问题讨论】:
标签: c# mysql connection-string