ProfileProvider.DeleteProfiles Method

Definition

Deletes profile properties and information from the data source.

Overloads

DeleteProfiles(String[])

When overridden in a derived class, deletes profile properties and information for profiles that match the supplied list of user names.

DeleteProfiles(ProfileInfoCollection)

When overridden in a derived class, deletes profile properties and information for the supplied list of profiles.

DeleteProfiles(String[])

When overridden in a derived class, deletes profile properties and information for profiles that match the supplied list of user names.

public abstract int DeleteProfiles (string[] usernames);

Parameters

usernames
String[]

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

Returns

The number of profiles deleted from the data source.

Examples

The following code example shows the method signature for an implementation of the DeleteProfiles method. For an example of a full ProfileProvider implementation, see How to: Build and Run the Profile Provider Example.

public override int DeleteProfiles(string[] usernames)
{
    return 0;
}

Remarks

The DeleteProfiles method deletes the profiles specified in the usernames parameter. Only data for the applicationName specified in the configuration file is removed.

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

DeleteProfiles(ProfileInfoCollection)

When overridden in a derived class, deletes profile properties and information for the supplied list of profiles.

public abstract int DeleteProfiles (System.Web.Profile.ProfileInfoCollection profiles);

Parameters

profiles
ProfileInfoCollection

A ProfileInfoCollection of information about profiles that are to be deleted.

Returns

The number of profiles deleted from the data source.

Examples

The following code example shows the method signature for an implementation of the DeleteProfiles method. For an example of a full ProfileProvider implementation, see How to: Build and Run the Profile Provider Example.

public override int DeleteProfiles(ProfileInfoCollection profiles)
{
    return 0;
}

Remarks

The DeleteProfiles method deletes the profiles specified in the profiles parameter. Only data for the applicationName specified in the configuration file is removed.

When implementing this method in a derived class, you can use the applicationName value and the UserName property of each ProfileInfo object in the supplied ProfileInfoCollection to determine which profiles to delete from your data source.

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1