This documentation is archived and is not being maintained.

Membership::GetAllUsers Method (Int32, Int32, Int32%)

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

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

public:
static MembershipUserCollection^ GetAllUsers(
	int pageIndex, 
	int pageSize, 
	[OutAttribute] int% totalRecords
)

Parameters

pageIndex
Type: System::Int32

The index of the page of results to return. Use 0 to indicate the first page.

pageSize
Type: System::Int32

The size of the page of results to return. pageIndex is zero-based.

totalRecords
Type: System::Int32%

The total number of users.

Return Value

Type: System.Web.Security::MembershipUserCollection
A MembershipUserCollection of MembershipUser objects representing all the users in the database for the configured applicationName.

ExceptionCondition
ArgumentException

pageIndex is less than zero.

-or-

pageSize is less than 1.

The results returned by GetAllUsers are constrained by the pageIndex and pageSize parameters. The pageSize parameter identifies the maximum number of MembershipUser objects to return in the MembershipUserCollection. 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 for the configured applicationName. For example, if there are 13 users for the configured applicationName, and the pageIndex value was 1 with a pageSize of 5, the MembershipUserCollection returned would contain the sixth through the tenth users returned. totalRecords would be set to 13.

The following code example returns a list of users in pages of data with a count of the number of users currently online.

No code example is currently available or this language may not be supported.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0
Show: