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

AF SDK Reference

AFEnumerationSet.FindEnumerationSets Method (AFDatabase, String, AFSearchField, AFSortField, AFSortOrder, Int32)

AFEnumerationSet.FindEnumerationSets Method (AFDatabase, String, AFSearchField, AFSortField, AFSortOrder, Int32)

  • Last UpdatedNov 18, 2025
  • 3 minute read
AFEnumerationSet.FindEnumerationSets Method (AFDatabase, String, AFSearchField, AFSortField, AFSortOrder, Int32)
Performs a non-paged text search within the AFDatabase to retrieve a collection of AFEnumerationSet objects which have a field that match the specified query string.

Namespace:  OSIsoft.AF.Asset
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182

Syntax

public static AFNamedCollectionList<AFEnumerationSet> FindEnumerationSets(
	AFDatabase database,
	string query,
	AFSearchField field,
	AFSortField sortField,
	AFSortOrder sortOrder,
	int maxCount
)
Public Shared Function FindEnumerationSets ( 
	database As AFDatabase,
	query As String,
	field As AFSearchField,
	sortField As AFSortField,
	sortOrder As AFSortOrder,
	maxCount As Integer
) As AFNamedCollectionList(Of AFEnumerationSet)

Dim database As AFDatabase
Dim query As String
Dim field As AFSearchField
Dim sortField As AFSortField
Dim sortOrder As AFSortOrder
Dim maxCount As Integer
Dim returnValue As AFNamedCollectionList(Of AFEnumerationSet)

returnValue = AFEnumerationSet.FindEnumerationSets(database, 
	query, field, sortField, sortOrder, 
	maxCount)
public:
static AFNamedCollectionList<AFEnumerationSet^>^ FindEnumerationSets(
	AFDatabase^ database, 
	String^ query, 
	AFSearchField field, 
	AFSortField sortField, 
	AFSortOrder sortOrder, 
	int maxCount
)
static member FindEnumerationSets : 
        database : AFDatabase * 
        query : string * 
        field : AFSearchField * 
        sortField : AFSortField * 
        sortOrder : AFSortOrder * 
        maxCount : int -> AFNamedCollectionList<AFEnumerationSet> 

Parameters

database
Type: OSIsoft.AFAFDatabase
The AFDatabase to search for the requested objects.
query
Type: SystemString
The query string used for finding objects.

The query string (or match pattern) can include regular characters and wildcard characters. Regular characters must match exactly the characters specified in the query string. Wildcard characters can be matched with arbitrary fragments of the query string. Wildcard characters can be escaped using the single backslash (\) character. Use a double backslash (\\) to match a single backslash. The syntax of the query string has the following rules:

  • If or empty string, then everything will be matched.
  • If no wildcards, then an exact match on the query string is performed.
  • Wildcard * can be placed anywhere in the query string and matches zero or more characters.
  • Wildcard ? can be placed anywhere in the query string and matches exactly one character.
  • One character in a set of characters are matched by placing them within [ ]. For example, a[bc] would match 'ab' or 'ac', but it would not match 'ad' or 'abd'.
  • One character in a set of characters are not matched by placing them within [! ]. For example, a[!bc] would match 'ad', but it would not match 'ab', 'ac', or 'abd'.
  • A character in a range of characters from first to last are matched using the following syntax: [first - last]. For example, a[a-c] would match 'aa', 'ab', or 'ac', but it would not match 'ad' or 'abc'.

field
Type: OSIsoft.AFAFSearchField
Specifies which of the object's properties are searched.
sortField
Type: OSIsoft.AFAFSortField
The field or property of the object used to sort the returned collection.
sortOrder
Type: OSIsoft.AFAFSortOrder
The order that the returned collection is sorted.
maxCount
Type: SystemInt32
The maximum number of objects to be returned.

Return Value

Type: AFNamedCollectionListAFEnumerationSet
Returns the collection of AFEnumerationSet objects which match the specified query string.

Remarks

An object matches the text search if the specified query is found in one of the object's properties specified by the field parameter.

Version Information

AFSDK


See Also

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