When storing a MySQL connection string in App.config, what value should the providerName property be set to?

纵饮孤独 提交于 2019-11-27 18:06:48

问题


When storing a MySQL connection string in App.config, what value should the providerName property be set to?

For example in the below App.config file, what value should I use for the providerName? Does it matter?

<?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>

回答1:


Try this:

<connectionStrings>
<add name="MySQL" connectionString="SERVER=8.8.8.8; DATABASE=foo; UID=bar; PASSWORD=foobar" providerName="MySql.Data.MySqlClient" />
</connectionStrings>


来源:https://stackoverflow.com/questions/13607334/when-storing-a-mysql-connection-string-in-app-config-what-value-should-the-prov

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!