Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AF SDK Reference

IAFSearch(T).GetTotalCount Method

  • Last UpdatedNov 18, 2025
  • 2 minute read
IAFSearch(T).GetTotalCount Method
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: Int32
Returns the total count of the items that will be returned from the search query.

Exceptions

ExceptionCondition
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.

Important note Important
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).

Version Information

AFSDK

Supported in: 3.1.1, 3.1.0, 3.0.2, 3.0.1, 3.0.0, 2.10.11, 2.10.5, 2.10.0, 2.10, 2.9.5, 2.9

See Also

In This Topic
TitleResults for “How to create a CRG?”Also Available in