Topaz Filer: if you use e-mail for business, we can save you money and decrease your risk.
error using the PageSize property in DirectorySearcher object
Messages   Related Types
This message was discovered on microsoft.public.dotnet.general.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Mario Rodriguez
Hi, my current conception is that setting the PageSize property of the
DirectorySearcher object to a value greater than 0, the paging is activated
and the query returns only the number of entries specified on the PageSize,
but in my case the query returns all the expected results at once.

This is the snippet:

DirectorySearcher objDirectorySearcher = new DirectorySearcher();

objDirectorySearcher.SearchRoot = new
DirectoryEntry(strRutaActiveDirectory);

objDirectorySearcher.Filter = getFilter(v_objPaginacion);

objDirectorySearcher.PageSize = 5;

SearchResultCollection objResultadoBusqueda =
objDirectorySearcher.FindAll();

and SearchResultCollection contains all the entries.

Any Idea ?

Reply to this message...
Vote that this is a GOOD answer...
 
Auto-following on Twitter
Ubuntu and XP on one “desktop”
 
    
Marc Scheuner [MVP ADSI] (VIP)
GOOD ANSWER
[Original message clipped]

No, your understanding of the page size parameter is wrong - it will
"slice up" the search and returning of the values into "page size"
chunks, but it'll do that transparently to you, in the background.

The result for you is the same - you get ALL the results.

Marc

================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
Reply to this message...
Vote that this is a GOOD answer... (13 votes from other users already)
 
 
 
System.DirectoryServices.DirectoryEntry
System.DirectoryServices.DirectorySearcher
System.DirectoryServices.SearchResultCollection




Ad
BootFX
Reliable and powerful .NET application framework.
Recession Busting Bespoke Software
Get through the recession by investing in bespoke software to decrease costs and create commercial opportunities.
Other DN247 Network Sites
.NET 247
SQL Server Wins
Old Skool Developer
 
Copyright © AMX Software Ltd 2008-2009. Portions copyright © Matthew Baxter-Reynolds 2001-2009. All rights reserved.
Contact Us - Terms of Use - Privacy Policy - .NET 247 is a member of the DN247 Network - 4.0.30129.1734