SaaS CMS has officially launched! Learn more now.

Rename connection string in .NET


I have this connection string:

<connectionStrings><clear /><add 

And was wondering if it is possible to rename it to something else other that EPiServerDB. Is it possible? We really need that on the current project as this name conflicts with another connection string which we hoped to use from an earlier project. The reason why is that we are integrating the old business layer into our new solution.

We are using EPiServer CMS 7, if that matters.

Apr 30, 2013 15:49



You will need to do a few steps to change this:


1. Add new section handler in web.config (if not present):

<section name="episerver.dataStore" type="EPiServer.Data.Configuration.EPiServerDataStoreSection, EPiServer.Data" />


2. Then add connection string name for your site (site Id is coming from episerver.framework section - usualy EPiServerFramework.config file):


    <add siteId="{SITE-ID}" connectionStringName="{NAME-YOUR-CONNECTION}" />



Hope that helps!

May 01, 2013 12:50

I had to rename all other references to that connection string as well. Other than that, it works. Can you explain what those settings I added do?

May 02, 2013 9:10

Yes, forgot to mention that you will need to udpate all other references to newly named connection (role providers, membership providers, etc).

When connection factory is initialized EPiServer asks for configuration data from data store configuration class (somewhere in EPiServer.Configuration & EPiServer.Data assemblies). By default there is convention (or default value) for connection string name ("EPiServerDB") which will be searched for in <connectionStrings> section or file. Using <dataStore> & <siteDataSettings> elements your are able to override default conventions.

May 02, 2013 9:18

Nice, thanks!

May 02, 2013 12:16
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.