Export (0) Print
Expand All

SimpleRoleProvider.FindUsersInRole Method

Returns all of the specified users who are in the specified role.

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

public override string[] FindUsersInRole(
	string roleName,
	string usernameToMatch
)

Parameters

roleName
Type: System.String
The role to search in.
usernameToMatch
Type: System.String
The user name to search for.

Return Value

Type: System.String[]
The names of all of the users where the user name matches usernameToMatch and the user is in the specified role.

The FindUsersInRole(String, String) method searches for all users that match the usernameToMatch parameter value using the SQL LIKE keyword. The method supports SQL wildcard characters. For example, if the usernameToMatch parameter is set to "user1", membership information for the user with the user name of "user1" is returned, if it exists. If the usernameToMatch parameter is set to "user%", membership information for users with the user name of "user1", "user2", "user_admin", and so on.

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