PC Review


Reply
Thread Tools Rate Thread

connection string for membership?

 
 
=?Utf-8?B?Tmljaw==?=
Guest
Posts: n/a
 
      6th Feb 2007
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
 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=
Guest
Posts: n/a
 
      6th Feb 2007
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

--
Milosz


"Nick" wrote:

> 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

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
AD Membership Connection Mick Walker Microsoft ASP .NET 1 24th Oct 2007 09:08 AM
How can I change the connection string for a Membership Provider in the Global.asax file? Alias Microsoft ASP .NET 0 15th Feb 2007 05:44 PM
Membership connection string Steven Blair Microsoft C# .NET 2 16th Aug 2006 04:14 PM
Connection String object Convert to String Variable Type =?Utf-8?B?TWlrZSBNb29yZQ==?= Microsoft ASP .NET 2 26th Oct 2004 03:43 PM
connection string exception : Format of the initialization string does not conform to specification starting at index 0 Gaurav Microsoft ASP .NET 0 7th Nov 2003 10:24 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:43 AM.