在aspnet_Membership表中添加新列 [英] Adding a new column to aspnet_Membership table

查看:88
本文介绍了在aspnet_Membership表中添加新列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在使用asp.net成员资格提供程序的用户注册过程中进行工作.当用户向应用程序注册时,一些用户详细信息(电子邮件ID,密码,密码盐,密码问题,答案等)存储在aspnet_Membership表中.

我们需要在同一表中添加两个其他列,以用于辅助密码问题和答案.我看到该表与成员资格存储过程有很多依赖关系.请让我知道如何将一些额外的列添加到该表中.

谢谢与问候,

Lakshmi

Hi All,

I am working on the user registration process which uses the asp.net membership provider. When users are registered with the application, the some of the user details(emailID, password, password salt, password question, answer etc) are stored in aspnet_Membership table.

We have a requirement of adding two additional columns in the same table for secondary password question and answer. I see that this table has a lot of dependencies with the membership stored procedures. Kindly let me know how some of the extra columns can be added to this table.

Thanks & Regards,

Lakshmi

推荐答案

你好,

无论是否可行,我都不建议更改现有表.建议使用成员资格存储过程.
您可以使用配置文件添加其他信息.但是,鉴于此要求,我建议添加一个额外的表,该表具有与要添加列的表相同的键.

我认为您可以使用MembershipUser检索此密钥:
Hello,

I wouldn''t recommend changing the existing tables, whether or not this is possible. It''s recommended to use the membership stored procudures.
You can add additional information using profiles. But given the requirement I would suggest adding an extra table which has the same key as the table where you wanted to add the columns.

I think you can retrieve this key using MembershipUser:
Dim mu As MembershipUser = Membership.Providers("ProviderName").GetUser("UserName", False)
Dim userId as String = mu.ProviderUserKey.ToString


这篇关于在aspnet_Membership表中添加新列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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