0
Reply

Using membership provider

roy roy

roy roy

Mar 26 2008 9:57 PM
5.1k

Hello.

Your help is very much appreciated.

I have number of web applications (VS 2005) that use an external dll for retrieving connection strings for databases (in order to make changes to connection strings easier).

The problem:

In one web application, I use sql role manager

<roleManager enabled="true" defaultProvider="SqlRoleManager">

                  <providers>

                        <clear/>

                        <add name="SqlRoleManager" type="System.Web.Security.SqlRoleProvider" connectionStringName="Intranet_1ConnectionString" applicationName="XXX"/>

                  </providers>

            </roleManager>

 

The sql role manager, requires connection string stored in the web config…

<
connectionStrings>

            <add name="Intranet_1ConnectionString" connectionString="my conn string" providerName="System.Data.SqlClient"/>

      </connectionStrings>

 

 

Having the connection string stored in the Web Config defeats the idea behind the external dll mentioned before.

Is there any way to provide the connection string for the sql membership provider programmatically?

If not, do you see any way around it?

 

Thank you,
Roy