System.Web.Security.Membership.DeleteUser Method

Deletes a user from the database.

Syntax

public static bool DeleteUser (string username, bool deleteAllRelatedData)

Parameters

username
The name of the user to delete.
deleteAllRelatedData
true to delete data related to the user from the database; false to leave data related to the user in the database.

Returns

true if the user was deleted; otherwise, false.

Remarks

Users deleted from the database are only deleted from the configured applicationName.

If deleteAllRelatedData is true, user data stored in the database for the System.Web.Security.Roles, System.Web.HttpContext.Profile, or System.Web.UI.WebControls.WebParts.WebPart personalization is also deleted when you are using the System.Web.Security.SqlRoleProvider, System.Web.Profile.SqlProfileProvider, and System.Web.UI.WebControls.WebParts.SqlPersonalizationProvider objects for data storage.

Requirements

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