I need to change the connection string that the .net Membership API uses. Basically the API loads the connection string from app.config on the first time you are calling it.
Does anyone knows how can I dynamically tell the API to use a different connection string?
<system.web>
<membership defaultProvider="SqlProvider">
<providers>
<clear />
<add name="SqlProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="MySqlConnection"
enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
passwordFormat="Hashed" maxInvalidPasswordAttempts="6545"
minRequiredPasswordLength="4" minRequiredNonalphanumericCharacters="0"
passwordAttemptWindow="10" passwordStrengthRegularExpression=""/>
</providers>
</membership>
<roleManager enabled="true" defaultProvider="RoleProvider">
<providers>
<add name="RoleProvider"
type="System.Web.Security.SqlRoleProvider"
connectionStringName="MySqlConnection" />
</providers>
</roleManager>
</system.web>
<connectionStrings>
<add name="MySqlConnection"
connectionString=".."
providerName="System.Data.SqlClient" />
</connectionStrings>
EDIT:
Solved - > Set connection string of membership dynamically from code