ASP.NET WebForm - 无效的列名称'User_Id' [英] ASP.NET WebForm - Invalid column name 'User_Id'

查看:67
本文介绍了ASP.NET WebForm - 无效的列名称'User_Id'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在使用现有(生成)登录机制(我创建了新的网络表单 - 网络应用程序项目)。



我在我的数据库中添加了用于标识的表并更改了conn字符串。



注册功能非常好,但是当我退出时,我无法登录再次。我得到异常:System.Data.SqlClient.SqlException:无效的列名'User_Id'。



在代码或数据库中没有我没有名称的属性或列User_Id。



错误行:

Hi,
I'm using existing (generated) mechanism for login (i was created new web form - web application project).

I added tables for identity in my database and changed the conn string.

Functionality for registration works very fine, but when I log out, I can not log in again. I get the exception: System.Data.SqlClient.SqlException: Invalid column name 'User_Id'.

Nowhere in the code or database I dont have attribute or column with name "User_Id".

Line of error:

authenticationManager.SignOut(DefaultAuthenticationTypes.ExternalCookie);



错误类别:IdentityHelper



我没有更改任何内容,只是我添加了此代码


Class of error: IdentityHelper

I did not change anything, except that I added this code

public class ApplicationRole : IdentityRole
{
    public ApplicationRole() { }
}

public class ApplicationRoleManager : RoleManager<ApplicationRole>
{
    public ApplicationRoleManager()
        : base(new RoleStore<ApplicationRole>(new ApplicationDbContext()))
    {
    }
}


用于管理用户规则的IdentityModels.cs中的




有没有人有有什么想法解决这个问题吗?谢谢


in IdentityModels.cs for managing user rules.

Does anyone have any idea for fix this problem? Thanks

推荐答案

问题发生在数据库中。解决方案可以在这里找到:

- 实体框架4.1列名无效 [ ^ ]

- 无效的列名User_Id [ ^ ]



谢谢
The problem was in the database. The solution can be found here:
- entity framework 4.1 invalid column name[^]
- Invalid column name "User_Id"[^]

Thanks


这篇关于ASP.NET WebForm - 无效的列名称'User_Id'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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