I want to overwrite the existing user profile that are in sp with my own one.
public string AccountName { get; set; }
public string WorkPhone { get; set; }
public string Department { get; set; }
public string Title { get; set; }
public string DistinguishedName { get; set; }
public string WorkEmail { get; set; }
public string Office { get; set; }
protected void Page_Load(object sender, EventArgs e)
{
}
public void Create()
{
string socialDataStatsSite = SPContext.Current.Site.Url;
using (SPSite siteColl = new SPSite(socialDataStatsSite))
{
SPServiceContext serviceContext = SPServiceContext.GetContext(siteColl);
UserProfileManager userProfileManager = new UserProfileManager(serviceContext);
UserProfile newProfile = userProfileManager.CreateUserProfile(AccountName, AccountName);
newProfile[PropertyConstants.WorkPhone].Add(WorkPhone);
newProfile[PropertyConstants.Department].Add(Department);
newProfile[PropertyConstants.Title].Add(Title);
newProfile[PropertyConstants.DistinguishedName].Add(AccountName);
newProfile[PropertyConstants.Office].Add(Office);
newProfile.Commit();
}
}
i have put this code in visual studio and deployed it.
Were do i find it in sharepoint to activate it?