How to add more user fields in aspnetdb database?

2.8k views Asked by At

I have created an ASPNETDB database on SQL Server 2008 for users, roles and profiles with Aspnet_regsql.exe.

But what I want to more user attributes apart from those default ones (name, email, mobile and comment), e.g. Postcode, Address, Telephone number, Rank, Position, etc. And also those new fields should be exposed to CreateNewUserWizard in the aspx page design mode, so that new user can be registered with more attributes.

I tried to add new columns in the "aspnet_Membership" table of ASPNETDB database. But they weren't automatically picked up.

Can anyone please give me some help on this? Thanks

Cheers, Alex

2

There are 2 answers

0
IrishChieftain On BEST ANSWER

Don't touch the database yourself. Follow the steps outlined here:

http://weblogs.asp.net/scottgu/archive/2005/10/18/427754.aspx

Note that you need to use the "Website" project template. Profiles are not supported out-of-the-box (without some customization) for the Web Application project template.

0
Murtaza On

Please refer aspnet_Profile table

To add additional attributes columns you will need to create Profile Properties in web.config file and access this Properties and update the Profile of the currently created user.

If you have complex information about users then u can create your table and use the foreign key relation ship to UserId in aspnet_users table.

Check this MSDN ARTICLE

HOW TO ADD PROPERTIES for Profile

Complete details of using Profiles in Asp.net C# is explained in one of the answer on StackOverflow itself please refer how-to-assign-profile-values