System.Web.Profile.ProfileManager.DeleteProfiles Method

Deletes profile properties and information for the supplied list of user names.

Syntax

public static int DeleteProfiles (string[] usernames)

Parameters

usernames
A string array of user names for profiles to be deleted.

Returns

The number of profiles deleted from the data source.

Remarks

The ProfileManager.DeleteProfiles(String[]) method deletes all profile information and properties for the specified profiles from the data source for the application specified by the ProfileManager.ApplicationName property. The list of profiles to delete is specified as a string array of user names. If profile properties and information exist in the data source for a user name in the usernames parameter, they are deleted.

The return value may differ from the length of the specified array of usernames. This indicates that some of the profiles in the specified array of usernames were already deleted from the data store.

The ProfileManager.DeleteProfiles(String[]) method calls the ProfileProvider.DeleteProfiles(String[]) method of the default profile provider. 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