Proficy Historian Client Access API
Proficy.Historian.ClientAccess.API Namespace / ICollectors Interface / Query Method
Query details.
Query results.
Example



In This Topic
    Query Method (ICollectors)
    In This Topic
    Retrieve a list of collectors in a Historian server matching a collector-name wildcard expression.

    For large servers clients can optionally rely on large message sizes or result-paging or a combination of both to retrieve properties for a large number of collectors. Maximum message size is straight-forward and controlled by ConnectionProperties.MaxReceivedMessageSize - it must be matched on both client and server.

    Result-paging enables large result sets to be retrieved across multiple server requests with timing and size controlled by the client. The number of results retrieved per request is controlled via the query's PageSize property. To utilize result-paging, specify a non-zero PageSize and continue calling the same query while the return code is true to retrieve all results from a server. To protect the server and limit excessive server-memory utilization initiating a second query without first retrieving all results for a first query generates a fault.

    Syntax
    'Declaration
     
    Function Query( _
       ByRef query As CollectorQueryParams, _
       ByRef collectors As List(Of Collector) _
    ) As Boolean
    'Usage
     
    Dim instance As ICollectors
    Dim query As CollectorQueryParams
    Dim collectors As List(Of Collector)
    Dim value As Boolean
     
    value = instance.Query(query, collectors)
    bool Query( 
       ref CollectorQueryParams query,
       out List<Collector> collectors
    )

    Parameters

    query
    Query details.
    collectors
    Query results.

    Return Value

    Whether additional results remain available on server.
    Example
    CollectorQueryParams query = new CollectorQueryParams();
    List<Collector> list = new List<Collector>(), temp = null;
                  
    // simple query
    connection.ICollectors.Query(ref query, out list);
                  
    // paged query
    list.Clear();
    query.PageSize = 100; // return at most 100 results per request
    while (connection.ICollectors.Query(ref query, out temp))
      list.AddRange(temp);
    list.AddRange(temp);
    Requirements

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

    See Also