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

走远了吗. 提交于 2020-04-12 14:05:15

问题


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;
            }
        }
    }

回答1:


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)



来源:https://stackoverflow.com/questions/23965897/whats-the-diff-between-dbo-aspnet-users-and-dbo-aspnetusers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!