Export (0) Print
Expand All

SimpleRoleProvider.RemoveUsersFromRoles Method

Removes the specified user names from the specified roles.

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

public override void RemoveUsersFromRoles(
	string[] usernames,
	string[] roleNames


Type: System.String[]
The user names to remove from the specified roles.
Type: System.String[]
The role names to remove the specified user names from.


One or more of the specified roles do not exist.


One or more users are not in all of the specified roles.


The database operation failed.

Even if you want to remove only one user from one role, you must pass arrays to both the usernames and roleNames parameters.


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.
© 2014 Microsoft