System.Web.Security.SqlRoleProvider.RemoveUsersFromRoles Method

Removes the specified user names from the specified roles.

Syntax

public override 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 be removed from the specified roles.

Remarks

The SqlRoleProvider.RemoveUsersFromRoles(String[], String[]) method is called by the System.Web.Security.Roles class to remove one or more users from one or more roles in the SQL Server database specified in the ASP.NET application's configuration file (Web.config). This method is called by the Roles.RemoveUserFromRole(string, string), Roles.RemoveUserFromRoles(string, String[]), Roles.RemoveUsersFromRole(String[], string), and Roles.RemoveUsersFromRoles(String[], String[]) methods of the System.Web.Security.Roles class.

The database updates that are performed during the call to SqlRoleProvider.RemoveUsersFromRoles(String[], String[]) are made within a transaction. If an error is encountered, such as a user name that does not exist or a user name that is already in a specified role, the transaction is rolled back and no updates are performed.

User names and role names cannot contain commas.

Requirements

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