System.Web.Security.SqlRoleProvider.DeleteRole Method

Removes a role from the role database.

Syntax

public override bool DeleteRole (string rolename, bool throwOnPopulatedRole)

Parameters

rolename
Documentation for this section has not yet been entered.
throwOnPopulatedRole
If true, throws an exception if roleName has one or more members.

Returns

true if the role was successfully deleted; otherwise, false.

Remarks

The SqlRoleProvider.DeleteRole(string, bool) method is called by the System.Web.Security.Roles class to delete a role from the SQL Server database specified in the ASP.NET application's configuration file (Web.config). When a role is deleted, the list of users associated with that role is also deleted from the database. The user information in the database is not affected.

If throwOnPopulatedRole is true, then an exception will be thrown and the role will not be deleted if the role identified by the roleName parameter has one or more members. If throwOnPopulatedRole is false, then the role will be deleted whether it is empty or not.

Requirements

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