The entry '' has already been added error
it can be in web.config that is parent to this one. just add
<remove name="conn2" />
before your add it (again) :)
alternatively clear all connection string using
<clear />
I got this error and the issue turned out to be a web.config deployed to the root of the domain
If you override the ToString() method then this will work. Looks like the configuration mechanism uses that to check if something already exists in the collection
You should use <clear />
when adding any providers to your web.config. Read this article: http://weblogs.asp.net/scottgu/archive/2006/11/20/common-gotcha-don-t-forget-to-clear-when-adding-providers.aspx
The root cause of the above problem rests in how the new provider was registered within the web.config file.
The section within the web.config file is implemented as a collection, and so it is possible to register multiple providers at the same time
If you have another project using the same connection string name you will receive this error because that connection string has already been added to the collection.