You don't have to create a custom provider in order to add fields to the User table (though it may be the proper solution, depending, it's not mandatory).
To add a field to the Users table, go to SQL Server Management Studio, find and expand aspnetdb. Expand Tables and right click on Users. Choose Design, add the fields you want and click save. That's it!
EDIT: Implementing Profiles
Okay, let's assume you want to add two Profile attributes to your users: FirstName and LastName, both strings (or nvarchar in db terms)
Web.Config
(the name and type are defaults, you'll need to set your connection string for the aspnetdb)
<profile>
<providers>
<clear/>
<add name="AspNetSqlProfileProvider"
type="System.Web.Profile.SqlProfileProvider"
connectionStringName="ApplicationServices"
applicationName="/"/>
</providers>
<properties>
<add name="FirstName" type="string"/>
<add name="LastName" type="string"/>
</properties>
</profile>
So now that you have a profile provider configured and properties defined, you can work with them via the ProfileBase
class.
For example, when a new user registers at your site, in addition to the username and password that is required for Membership.CreateUser, you can ask your users to enter their first and last names. Once they've posted the form back to your server, you'd process it like so:
[HttpPost]
public ActionResult CreateUser( ViewModel viewModel )
{
if (ModelState.IsValid)
{
MembershipCreateStatus status;
var newUser = Membership.CreateUser( viewModel.UserName, viewModel.Password, viewModel.EmailAddress, null, null, true, null, out status );
if (status == MembershipCreateStatus.Success)
{
//set profile data
ProfileBase profile = ProfileBase.Create(viewModel.UserName);
profile["FirstName"] = viewModel.FirstName;
profile["LastName"] = viewModel.LastName;
profile.Save();
}
Editing Profile data is the same as creating it.
Getting Profile data for a user is just as easy:
var profile = ProfileBase.Create(userName);
var firstName = profile["FirstName"] as string;
var lastName = profile["LastName"] as string;
Hope this helps get you going!