Best way to add to a profile at a later time?

  • Thread starter Thread starter VB Programmer
  • Start date Start date
V

VB Programmer

ASP.NET 2.0....

This profile stuff is great. But, what if, after rolling out the site, I
want to add a few items to the profile in the web.config, etc... Will the
existing records get updated, just with blank values, or do I have to
somehow "clean up the data" and add the new profile items?

For example, let's say I have FirstName, LastName, Address in my profile for
each user. Later I want to add FavoriteColor. Already there are 100 users
in the database. What's the best way to handle this?

Thanks!
 
Just specify a default value for the property in web.config, i.e. <add
name="FavoriteColor" defaultValue="Red"/>. No need to do any cleanup.

If you ever do need to walk through all the profile entries, use
ProfileProvider.GetAllProfiles.
 
Thanks Scott!

2.0 rocks!

Scott Allen said:
Just specify a default value for the property in web.config, i.e. <add
name="FavoriteColor" defaultValue="Red"/>. No need to do any cleanup.

If you ever do need to walk through all the profile entries, use
ProfileProvider.GetAllProfiles.
 
Back
Top