在App.config中存储MySQL连接字符串时,应将providerName属性设置为什么值?
例如,在下面的App.config文件中,我应该为providerName使用什么值?这有关系吗?
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<connectionStrings>
<add name="MySQL" connectionString="SERVER=8.8.8.8; DATABASE=foo; UID=bar; PASSWORD=foobar" providerName="WhatGoesHere?" />
</connectionStrings>
</configuration>
答案 0 :(得分:15)
试试这个:
<connectionStrings>
<add name="MySQL" connectionString="SERVER=8.8.8.8; DATABASE=foo; UID=bar; PASSWORD=foobar" providerName="MySql.Data.MySqlClient" />
</connectionStrings>