DeleteUser Method

SimpleMembershipProvider.DeleteUser Method

Deletes the specified user account, and optionally deletes all profile data that is related to that user account.

Namespace:  WebMatrix.WebData
Assembly:  WebMatrix.WebData (in WebMatrix.WebData.dll)

public override bool DeleteUser(
	string username,
	bool deleteAllRelatedData


Type: System.String
The user name.
Type: System.Boolean
true to delete profile data that is related to the user, or false to retain data that is related to the user.

Return Value

Type: System.Boolean
true if the user account was deleted; otherwise, false.


username is null or empty.

This method deletes the entry in the membership account table (by default, webpages_Membership). If deleteAllRelatedData is true, all user data that is stored in the user table is also deleted.


If the InitializeDatabaseConnection() method has not been called, and if you have configured your site to use the standard ASP.NET membership provider, this method is passed through to the standard membership provider. For more information, see the SimpleMembershipProvider class overview.

© 2015 Microsoft