iamjonesy
iamjonesy

Reputation: 25132

asp.net membership select provider

I've done this before but can't remember how for the life of me. I used aspnetreg_sql.exe to create the membership tables in my database. But now i cant seem to be able to point my web app to the correct database. In the provider settings in asp.net management interface i only see a radio button with the label "AspNetSqlProvider" but I can only test it (in which it always fails). I can't modify the connection. Can someone help me with this?

Cheers, Billy

Upvotes: 1

Views: 298

Answers (3)

Brian Mains
Brian Mains

Reputation: 50728

The membership provider needs to clear the existing result and add in the new result with the new connection; the default uses the local sql server.

<membership defaultProvider="p">
  <providers>
    <clear />
    <add name="p" type="System.Web.Security.SqlMembershipProvider" connectionStringName="myConnectionString" ... />
</providers>

So the keys here is to clear the existing provider, setting the default provider to the name of your entry, and adding a new entry with the in-built membership provider that points to your DB.

Upvotes: 3

Steve
Steve

Reputation: 5952

Look for something like this in the web.config:

<membership defaultProvider="AspNetSqlProvider" userIsOnlineTimeWindow="15">
<providers>
 <add name="zzz" type="System.Web.Security.SqlMembershipProvider" connectionStringName="appServicesConn" applicationName="zzz" enablePasswordRetrieval="false" enablePasswordReset="false" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" minRequiredNonalphanumericCharacters="0" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="8" passwordAttemptWindow="5" passwordStrengthRegularExpression="" passwordFormat="Hashed" />
</providers>

That should point you to the connection string.

Upvotes: 1

James Westgate
James Westgate

Reputation: 11464

The connection information should be in the web.config file under the <connectionstrings> section.

Upvotes: 0

Related Questions