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 Overrides Function FindUsersInRole ( _
	roleName As String, _
	usernameToMatch As String _
) As String()
Dim instance As SimpleRoleProvider
Dim roleName As String
Dim usernameToMatch As String
Dim returnValue As String()

returnValue = instance.FindUsersInRole(roleName, _


Type: System.String
The role to search in.
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.


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.