nicomp
nicomp

Reputation: 4657

What's the diff between dbo.aspnet_Users and dbo.aspnetUsers?

VS 2013, Framework 4.5.1 ...

I ran Aspnet_regsql.exe to create the schema. It created the tables with an underscore in them: aspnet_Users for example. It also created the associated stored procedures. Those stored procedures do work and they add records to the tables: a user is added to aspnet_Users, for example.

When I try to use Login.aspx, it crashes on the manager.Find with the error: "Invalid object name 'dbo.AspNetUsers'."

    protected void LogIn(object sender, EventArgs e)
    {
        if (IsValid)
        {
            // Validate the user password
            var manager = new UserManager();
            ApplicationUser user = manager.Find(UserName.Text, Password.Text);
            if (user != null)
            {
                IdentityHelper.SignIn(manager, user, RememberMe.Checked);
                IdentityHelper.RedirectToReturnUrl(Request.QueryString["ReturnUrl"], Response);
            }
            else
            {
                FailureText.Text = "Invalid username or password.";
                ErrorMessage.Visible = true;
            }
        }
    }

Upvotes: 9

Views: 2547

Answers (1)

yazan_ati
yazan_ati

Reputation: 263

The authentication model changed between .Net VS2012 and VS2013, hence the AspNetDB tables and table structures, e.g.

dbo.aspnet_Users become dbo.AspNetUsers with totally different designs and rules (e.g. hyphen forbidden in Username)

Upvotes: 7

Related Questions