gpt4 book ai didi

sql-server - 为什么我不能向我的用户表添加新列?

转载 作者:行者123 更新时间:2023-12-01 06:23:48 24 4
gpt4 key购买 nike

我正在做一些功课。我的数据库的用户使用其他一些属性,而不仅仅是在我实现登录和注册机制时 ASP 2.0 自动为我创建的属性。但是当我尝试保存修改时会显示一个错误。有人可以帮我吗?
这是错误:

enter image description here
错误说:

'aspnet_Users' table - Unable to modify table. ALTER TABLE only allows columns to be added that can contain nulls, or have a DEFAULT definition specified, or the column being added is an identity or timestamp column, or alternatively if none of the previous conditions are satisfied the table must be empty to allow addition of this column. Column 'kjoptekvoten' cannot be added to non-empty table 'aspnet_Users' because it does not satisfy these conditions.



当我实现基于表单的身份验证和注册时,该数据库是自动创建的。现在的问题是用户需要更多的属性。我怎样才能给它更多的属性?最简单的方法是什么?不介意理论上不正确(仅用于家庭作业)。

我将不胜感激您的帮助。

最佳答案

除了数据库方面的技术问题,这里还有一个更深层次的问题。

您不应更改 aspnet_Users 表,因为您绕过了 asp.net 中成员资格“系统”的工作方式。相反,请查看 Profile 机制:http://www.4guysfromrolla.com/articles/101106-1.aspx

关于sql-server - 为什么我不能向我的用户表添加新列?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5930490/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com