App Muncher

Issues faced - solutions identified - shared with community.

Received error after deploying a package in IIS 7.5 as "The entry 'ConnectionString' has already been added."

The error was pointing to following connection string

name="ConnectionString" 
connectionString="Data Source=localhost;Initial Catalog=Care_test;Persist Security Info=false;User ID=sa;Password=XXXXXXXX" 
providerName="System.Data.SqlClient" 
/>


The error occurred due to multiple ConnectionString with same name but pointing to different Catalog (databases).

To overcome the issue:
1. Check the Connection Strings in your site in IIS.
2. Remove the ones which are not in use.
3. Else update ConnectionString.config as follows:

<?xml version="1.0" encoding="UTF-8"?>
<connectionstrings>
<remove name="XXXXConnectionString" />
<remove name="LocalSqlServer" />
<add name="XXXXConnectionString" connectionString="Data Source=localhost;Initial Catalog=Care_test;Persist Security Info=false;User ID=sa;Password=XXXXX" providerName="System.Data.SqlClient" />
</connectionStrings>

No comments:

Post a Comment

| Designed by AppMuncher