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
)

Parameters

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

ExceptionCondition
InvalidOperationException

One or more of the specified roles do not exist.

-or-

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

ProviderException

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.

NoteNote:

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