I have the default membership table that was added automatically, then just used server explorer to add more columns, like FirstName, LastName, etc. In my code I can access all the default columns, but not the ones I created. Any thing special I need to do?
Here is how I access the table. using user. gives me all columns, but the one I created.
string userName = User.Identity.Name;
MembershipUser user = (MembershipUser)System.Web.Security.Membership.GetUser(userName).ProviderUserKey;
The reason you are not able to do that is because MembershipUser doesn’t expose those properties. You will have to extend that class in order to do that and lot more which will be a lot of work. Also I wouldn’t recommend modifying the existing membership tables.
You have two options:
1: Use built-in asp.net profiles as mentioned by Derek Beattie.
or
2: Create a separate table to store additional user details. Here’s how you do that:
Store-Additional Information
Custom Table
In case if you want to go long route here is how to extend existing membership API.