System.Web.Security.Roles.RemoveUsersFromRole Method

Removes the specified users from the specified role.

Syntax

public static void RemoveUsersFromRole (string[] usernames, string rolename)

Parameters

rolename
Documentation for this section has not yet been entered.
usernames
A string array of user names to remove from the specified roles.

Remarks

The Roles.RemoveUsersFromRole(String[], string) method calls the default role provider to remove the specified users from the specified role at the data source.

If the application uses the System.Web.Security.SqlRoleProvider class, the database updates that are performed during the call to the SqlRoleProvider.RemoveUsersFromRoles(String[], String[]) method are made within a transaction. If an error is encountered, such as a user name that is not in a specified role, the transaction is rolled back and no updates are performed.

Requirements

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