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

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!
 
S

Scott Allen

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top