Multiple Profiles and providers in the same web.config?

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.
 
N

Nanda Lella[MSFT]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top