0

I have 2 SQL express databases: one for my application data and another for the MembershipProvider data. When I attempt to use the CreateUserWizard control, I get the following error:

Error: Login failed for user 'SFP\Susan'.

I can connect to thesee the DB in the server explorer and all its tables and data. What is the problem?

Thanks in advance

1 Answer 1

1

It sounds like the MembershipProvider connection is not correctly set up in your web.config file. It should look something like this (with "MyAwesomeDatabaseConnectionName" being the name of the configured connection string, in the connectionStrings section of the file):

<membership>
  <providers>
    <clear/>
    <add name="AspNetSqlMembershipProvider" 
         type="System.Web.Security.SqlMembershipProvider" 
         connectionStringName="MyAwesomeDatabaseConnectionName" 
         applicationName="MyAwesomeApp"/>
  </providers>
</membership>

Also, it looks like you are configured for Windows authentication, but if your membership data is in a database, you'll want to configure for Forms authentication:

<authentication mode="Forms">
  <forms loginUrl="~/myloginpage.aspx" 
         defaultUrl="~/myhomepage.aspx" />
</authentication>
Sign up to request clarification or add additional context in comments.

2 Comments

In the provider block, can the NAME be anything or is it the name of my database, ASPNETDB.
It can be anything. Your database connection string is referenced in the 'connectionStringName' property.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.