Reputation: 199
i am trying to connect my local MySQL database to my windows form application using app.config. but i am keep on getting the below mentioned Exception.Can anyone help me please. Exception :
App.config be like :
<configuration>
<connectionstrings>
<!--<add name ="support_KB" connectionstring="server= .\sqlexpress;database=kbase_support;Integrated Security=SSPI" />-->
<add name ="MyConnectionstringname"
providerName="System.Data.SqlClient"
connectionstring="Data Source=.\sqlexpress;Initial Catalog=kbase_support;Integrated Security=SSPI" />
</connectionstrings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
Upvotes: 2
Views: 337
Reputation: 700152
The tag name is case sensetive, it should be:
<connectionStrings>
...
</connectionStrings>
Note: System.Data.SqlClient
is the provider for Microsoft SQL Server, not MySQL.
Upvotes: 4
Reputation: 762
Two things to note here.
MyConnectionstringname
Upvotes: 0
Reputation: 2917
You have two end tags </configSections>
. Remove the one before <connectionstrings>
And, <connectionstrings>
is case sensitive. It should be <connectionStrings>
Upvotes: 0