IAFSearch(T).GetTotalCount Method
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
Returns the total count of the items that could be returned from the search query.
Namespace: OSIsoft.AF.Search
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
int GetTotalCount()
Function GetTotalCount As Integer Dim instance As IAFSearch Dim returnValue As Integer returnValue = instance.GetTotalCount()
int GetTotalCount()
abstract GetTotalCount : unit -> int
Return Value
Type: Int32Returns the total count of the items that will be returned from the search query.
Exceptions
| Exception | Condition |
|---|---|
| FormatException | This exception is thrown if the ThrowOnError property is and there is a format error in the search query. |
| NotSupportedException | This exception is thrown if the ThrowOnError property is and one of the filters is not supported or the query is too complex to be evaluated by the server. |
Remarks
This method will evaluate the search query and return the total number of items that could be found by the query. This will not actually return any items.
| The total count returned by this method maybe greater that the actual number of items returned from the search query if items must be filtered out on the client. For example, attribute value queries that use a data reference will need to be evaluated on the client if they are not captured (see CaptureValues). |