Multiple Profiles and providers in the same web.config?

  • Thread starter Thread starter Andy B
  • Start date Start date
A

Andy B

Is it possible to have more than 1 profile section in the same web.config
that use different sql databases for each one? If so, how do you set it up?
I need to know the same thing for Providers.
 
Andy,


You can definitely create and maintain multiple providers in the Prifile
section of web.config that uses different connection strings.
But you can only have one profile section in a given config file.

for example...

<connectionStrings>
<add name="SqlServices" connectionString="Data
Source=localhost;Integrated Security=SSPI;Initial
Catalog=aspnetdb;" />
<add name="SqlServices2" connectionString="Data
Source=DBSERVER;Integrated Security=SSPI;Initial
Catalog=SERVERaspnetdb;" />
</connectionStrings>


<membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="15">
<providers>
<clear/>
<add name="SqlProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="SqlServices"
applicationName="SampleApplication"
enablePasswordRetrieval="true"
enablePasswordReset="true"
passwordFormat="Encrypted"
requiresQuestionAndAnswer="true" />

<add name="SqlProvider2"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="SqlServices2"
applicationName="SampleApplication"
enablePasswordRetrieval="true"
enablePasswordReset="true"
passwordFormat="Encrypted"
requiresQuestionAndAnswer="true" />
</providers>
</membership>

<profile defaultProvider="SqlProvider">
<providers>
<clear />
<add name="SqlProvider"
type="System.Web.Profile.SqlProfileProvider"
connectionStringName="SqlServices"
applicationName="SampleApplication"
description="SqlProfileProvider for SampleApplication" />

<add name="SqlProvider2"
type="System.Web.Profile.SqlProfileProvider"
connectionStringName="SqlServices2"
applicationName="SampleApplication"
description="SqlProfileProvider2 for SampleApplication" />
</providers>

</profile>




--

Thank You,
Nanda Lella,

This Posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top