开发者

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 onl开发者_开发百科y 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


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.


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜