TermStore.GetTermSets Method (String )

Gets a collection of all TermSet objects in this TaxonomyTermStore object that the current user has permissions to read that contain terms with labels matching or starting with each of the specified strings.

Namespace:  Microsoft.SharePoint.Taxonomy
Assembly:  Microsoft.SharePoint.Taxonomy (in Microsoft.SharePoint.Taxonomy.dll)

Syntax

'Declaration
Public Function GetTermSets ( _
    requiredTermLabels As String() _
) As TermSetCollection
'Usage
Dim instance As TermStore
Dim requiredTermLabels As String()
Dim returnValue As TermSetCollection

returnValue = instance.GetTermSets(requiredTermLabels)
public TermSetCollection GetTermSets(
    string[] requiredTermLabels
)

Parameters

  • requiredTermLabels
    Type: []

    A set of labels to match against the Term.Labels of each TermSet

Return Value

Type: Microsoft.SharePoint.Taxonomy.TermSetCollection
A collection of all TermSets in this TermStore that the current user has permissions to read that contain terms with labels matching or starting with each of the specified strings.

Exceptions

Exception Condition
ArgumentNullException

The requiredTermLabels value cannot be null.

ArgumentNullException

The labels in requiredTermLabels cannot be null or empty.

ArgumentException

The value of one or more labels in requiredTermLabels is invalid. It probably contains invalid characters or is too long.

Remarks

The value of the labels in requiredTermLabels cannot be null or empty, and must not exceed 255 characters in length. They also cannot contain any of the following illegal characters ; " < > | & tab The search is case-insensitive. A TermSet will be included in the returned collection if, for each label value in requiredTermLabels, the TermSet contains a Term with a label that matches or starts with the value. There is no requirement for a single Term to contain all of the specified labels.To get the most accurate results it is recommended that any pending changes be committed to the database using CommitAll() prior to executing this search.

See Also

Reference

TermStore Class

TermStore Members

GetTermSets Overload

Microsoft.SharePoint.Taxonomy Namespace

Labels

GetTermSets(String, Int32)

GetTermSets([], Int32)