Export (0) Print
Expand All

SimpleMembershipProvider.FindUsersByName Method

Returns all of the user accounts whose name matches the specified user name.

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

public override MembershipUserCollection FindUsersByName(
	string usernameToMatch,
	int pageIndex,
	int pageSize,
	out int totalRecords
)

Parameters

usernameToMatch
Type: System.String
The user name to search for.
pageIndex
Type: System.Int32
The zero-based index of the page of results to return.
pageSize
Type: System.Int32
The size of the page of results to return.
totalRecords
Type: System.Int32
When this method returns, contains the total number of matched users.

Return Value

Type: System.Web.Security.MembershipUserCollection
A collection that contains a page of pageSize user accounts starting at the page specified by pageIndex.

This method returns results that are in logical pages. This lets you return user information in manageable chunks. For example, if your application currently has 2000 user accounts, you can return 200 pages of 10 users at a time.

The specific page to return is defined by the pageIndex and pageSize parameters. The totalRecords parameter is an out parameter that is set to the total number of user accounts that matched the usernameToMatch value. For example, if 13 users are found, and the pageIndex value is 1 and pageSize is 5, the MembershipUserCollection object contains the sixth through the tenth user accounts and totalRecords is set to 13.

NoteNote

If the SimpleMembershipProvider class has been initialized using a call to the WebSecurity.InitializeDatabaseConnection() method, this method is not supported and will throw a NotSupportedException exception. However, if the WebSecurity.InitializeDatabaseConnection() method has not been called, and if you have configured your site to use the standard ASP.NET membership provider, this method is passed through to the standard membership provider. For more information, see the SimpleMembershipProvider class overview.

Show:
© 2014 Microsoft