Reputation: 410
Summary: I am trying to use asp.net membership, roles, and profiles, but am having trouble getting my code to use the tables generated by aspnet_regsql.exe.
What I tried:
Membership.CreateUser("tester7","tester7","[email protected]");
This then created the following tables and stored the user in dbo.Memberships instead of dbo.aspnet_Memberships.
It completely ignored the tables created by aspnet_regsql.exe.
Why is this happening and what can I do to target to aspnet_* tables?
Edit to include Web.config Membership registration
<membership defaultProvider="ProjectMembershipProvider">
<providers>
<add name="ProjectMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider,..." connectionStringName="ProjectSql" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="Project" />
</providers>
</membership>
Upvotes: 2
Views: 858
Reputation: 28990
You must add registering section in your config file
System.Web.Providers.DefaultMembershipProvider are on Sql Compact and Azur application
You have section for membership and another for role manager
<membership>
<providers>
<add
name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider, ..."
connectionStringName="LocalSqlServer"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
applicationName="/"
requiresUniqueEmail="false"
passwordFormat="Hashed"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="7"
minRequiredNonalphanumericCharacters="1"
passwordAttemptWindow="10"
passwordStrengthRegularExpression=""
/>
</providers>
</membership>
Upvotes: 1