System.Web.Profile.ProfileManager.DeleteProfiles Method

Deletes profile properties and information from the data source for the supplied list of profiles.

Syntax

public static int DeleteProfiles (ProfileInfoCollection profiles)

Parameters

profiles
A System.Web.Profile.ProfileInfoCollection that contains profile information for profiles to be deleted.

Returns

The number of profiles deleted from the data source.

Remarks

The ProfileManager.DeleteProfiles(ProfileInfoCollection) 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 using a System.Web.Profile.ProfileInfoCollection that is passed as the profiles parameter. A System.Web.Profile.ProfileInfoCollection can be returned from the ProfileManager.GetAllProfiles(ProfileAuthenticationOption, int, int, Int32@), ProfileManager.GetAllInactiveProfiles(ProfileAuthenticationOption, DateTime, int, int, Int32@), ProfileManager.FindProfilesByUserName(ProfileAuthenticationOption, string, int, int, Int32@), and ProfileManager.FindInactiveProfilesByUserName(ProfileAuthenticationOption, string, DateTime, int, int, Int32@) methods.

Note that the return value may differ from the ProfileInfoCollection.Count value for the supplied System.Web.Profile.ProfileInfoCollection. This indicates that some of the profiles in the specified System.Web.Profile.ProfileInfoCollection were already deleted from the data store.

The ProfileManager.DeleteProfiles(ProfileInfoCollection) method calls the ProfileProvider.DeleteProfiles(ProfileInfoCollection) 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(ProfileInfoCollection) 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