This documentation is archived and is not being maintained.

DirectorySearcher.CacheResults Property

Gets or sets a value indicating whether the result is cached on the client computer.

Namespace: System.DirectoryServices
Assembly: System.DirectoryServices (in system.directoryservices.dll)

public bool CacheResults { get; set; }
/** @property */
public boolean get_CacheResults ()

/** @property */
public void set_CacheResults (boolean value)

public function get CacheResults () : boolean

public function set CacheResults (value : boolean)

Not applicable.

Property Value

true if the result is cached on the client computer; otherwise, false. The default is true.

If the search returns a large result set, the search will be more efficient if this property is set to false to avoid the transfer of the result set to the client computer. If you do so, however, you will not be able to enumerate the results twice, because the SearchResultCollection object creates a new enumerator object each time it is called.

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

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0
Show: