dbo.aspnet_Users和dbo.aspnetUsers之间有什么区别? [英] What's the diff between dbo.aspnet_Users and dbo.aspnetUsers?

查看:218
本文介绍了dbo.aspnet_Users和dbo.aspnetUsers之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

VS 2013,Framework 4.5.1 ...

VS 2013, Framework 4.5.1 ...

我运行Aspnet_regsql.exe创建架构.它创建了带有下划线的表:例如aspnet_Users.它还创建了关联的存储过程.这些存储过程确实起作用,并且它们将记录添加到表中:例如,将用户添加到aspnet_Users.

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.

当我尝试使用Login.aspx时,它在 manager.Find 上崩溃,并显示错误: 无效的对象名称'dbo.AspNetUsers'."

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

推荐答案

.Net VS2012和VS2013之间的身份验证模型发生了变化,因此,例如AspNetDB表和表结构

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

dbo.aspnet_Users成为具有完全不同的设计和规则(例如,用户名中禁止使用连字符)的dbo.AspNetUsers

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

这篇关于dbo.aspnet_Users和dbo.aspnetUsers之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆