System.Web.Security.Roles.FindUsersInRole Method

Gets a list of users in a specified role where the user name contains the specified user name to match.

Syntax

public static string[] FindUsersInRole (string rolename, string usernameToMatch)

Parameters

rolename
Documentation for this section has not yet been entered.
usernameToMatch
The user name to search for.

Returns

A string array containing the names of all the users whose user name matches usernameToMatch and who are members of the specified role.

Remarks

Roles.FindUsersInRole(string, string) returns a list of users in a role where the user name contains a match of the supplied usernameToMatch for the configured applicationName. For example, if the usernameToMatch parameter is set to "user," then the users "user1," "user2," "user3," and so on are returned. Users are returned in alphabetical order by user name.

The System.Web.Security.SqlRoleProvider performs its search using a LIKE clause against the usernameToMatch parameter. Any wildcards that are supported by SQL Server in LIKE clauses can be used in the usernameToMatch parameter value.

Requirements

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