我正在尝试在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.
有人知道为什么会这样吗?
谢谢你的关心。