System.Web.Security.Roles.RemoveUsersFromRoles Method

Removes the specified user names from the specified roles.

Syntax

public static void RemoveUsersFromRoles (string[] usernames, string[] rolenames)

Parameters

rolenames
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.RemoveUsersFromRoles(String[], String[]) method calls the default role provider to remove the specified users from the specified roles 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