Matthew Jones
Matthew Jones

Reputation: 26190

ASP.NET Profiles - Add a profile to an existing user

How do you add a profile entry (consisting of a guid, two strings, and an integer) to an existing user in the default SQL profile and membership providers? I can do this either via a sql query or C# code.

I need to add a bunch of these profiles to already existing users.

Upvotes: 1

Views: 1133

Answers (1)

dahlbyk
dahlbyk

Reputation: 77520

You can use various methods of ProfileBase:

var profile = ProfileBase.Create(username);
profile.SetPropertyValue("MyGuid", aGuid);
profile.SetPropertyValue("MyString", aString);
// etc
profile.Save()

Upvotes: 4

Related Questions