System.Web.Profile.ProfileManager.DeleteProfile Method

Deletes the profile for the specified user name from the data source.

Syntax

public static bool DeleteProfile (string username)

Parameters

username
The user name for the profile to be deleted.

Returns

true if the user profile was found and deleted; otherwise, false.

Remarks

The ProfileManager.DeleteProfile(string) method deletes all profile information and properties for the user profile for the specified username from the data source for the specified ProfileManager.ApplicationName.

The ProfileManager.DeleteProfile(string) method calls the ProfileProvider.DeleteProfiles(String[]) method of the default profile provider to perform the delete operation. The default profile provider is specified using the defaultProvider attribute of the profile configuration element. If the user profile contains properties that are managed by a profile provider other than the default provider, they are not deleted. To delete profile properties that are managed by a profile provider other than the default provider, obtain a reference to the profile provider using the ProfileManager.Providers property and call the ProfileProvider.DeleteProfiles(String[]) method of the provider directly.

Requirements

Namespace: System.Web.Profile
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0