MembershipProvider.GetAllUsers Method (System.Web.Security)

Switch View :
ScriptFree
.NET Framework Class Library
MembershipProvider.GetAllUsers Method

Gets a collection of all the users in the data source in pages of data.

Namespace:  System.Web.Security
Assembly:  System.Web.ApplicationServices (in System.Web.ApplicationServices.dll)
Syntax

Visual Basic
Public MustOverride Function GetAllUsers ( _
	pageIndex As Integer, _
	pageSize As Integer, _
	<OutAttribute> ByRef totalRecords As Integer _
) As MembershipUserCollection
C#
public abstract MembershipUserCollection GetAllUsers(
	int pageIndex,
	int pageSize,
	out int totalRecords
)
Visual C++
public:
virtual MembershipUserCollection^ GetAllUsers(
	int pageIndex, 
	int pageSize, 
	[OutAttribute] int% totalRecords
) abstract
F#
abstract GetAllUsers : 
        pageIndex:int * 
        pageSize:int * 
        totalRecords:int byref -> MembershipUserCollection 

Parameters

pageIndex
Type: System.Int32
The index of the page of results to return. pageIndex is zero-based.
pageSize
Type: System.Int32
The size of the page of results to return.
totalRecords
Type: System.Int32%
The total number of matched users.

Return Value

Type: System.Web.Security.MembershipUserCollection
A MembershipUserCollection collection that contains a page of pageSize MembershipUser objects beginning at the page specified by pageIndex.
Remarks

GetAllUsers returns a list of all of the users from the data source for the configured ApplicationName property. Users are returned in alphabetical order by user name.

The results returned by GetAllUsers are constrained by the pageIndex and pageSize parameters. The pageSize parameter identifies the number of MembershipUser objects to return in the MembershipUserCollection collection. The pageIndex parameter identifies which page of results to return, where 0 identifies the first page. The totalRecords parameter is an out parameter that is set to the total number of membership users in the database. For example, if there are 13 users in the database, and the pageIndex value was 1 with a pageSize of 5, then the MembershipUserCollection would contain the sixth through the tenth users returned. totalRecords would be set to 13.

Examples

For an example of a MembershipProvider implementation, see Implementing a Profile Provider.

Version Information

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4
Platforms

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
See Also

Reference

Other Resources

Community Content

darrylsk
Contradiction in the definiion
This description contradicts itself.  The parameter list says that the totalRecords parameter returns all "matched" users.  One wouldn't take this to mean "all users in the database" as the detailed description states.