connection string for membership?

G

Guest

Hi all,

i am new to membership, what i am trying to do is that. my asp pages data
are from server 1, and the membership data are from server 2. so can i write
do different connection string in web.config?

Cheers

Nick
 
G

Guest

Yes, you can change the default connection string for Membership/Profile.
Default connection is added in machine.config (you can find it in
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config):

<membership>
<providers>
<add name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="LocalSqlServer" enablePasswordRetrieval="false"
enablePasswordReset="true" requiresQuestionAndAnswer="true"
applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed"
maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7"
minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10"
passwordStrengthRegularExpression="" />
</providers>
</membership>
<profile>
<providers>
<add name="AspNetSqlProfileProvider"
connectionStringName="LocalSqlServer" applicationName="/"
type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</profile>

It's easy to replace default settings in web.config file using remove or
clear elements:

<connectionStrings>
<clear />
<add name="localSqlServer" connectionString="server=servername;user
id=username;password=mypassword;database=databasename"/>
</connectionStrings>

Done.

Hope this helps
 

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

Forum statistics

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

Latest Threads

Top