Export (0) Print
Expand All

SimpleRoleProvider.DeleteRole Method

Deletes the specified role.

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

public override bool DeleteRole(
	string roleName,
	bool throwOnPopulatedRole


Type: System.String
The name of the role to delete.
Type: System.Boolean
true to cause an exception to be thrown if one or more users are in roleName. In that case, the specified role is not deleted.

Return Value

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


roleName has one or more members, and throwOnPopulatedRole is true.


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

  • Medium trust for the immediate caller. This member can be used by partially trusted code.
© 2015 Microsoft