Group.CreateTermSet Method (String, Int32)

Creates a new TermSet object in the current Group object by using the provided language.

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

Syntax

'Declaration
Public Function CreateTermSet ( _
    name As String, _
    lcid As Integer _
) As TermSet
'Usage
Dim instance As Group
Dim name As String
Dim lcid As Integer
Dim returnValue As TermSet

returnValue = instance.CreateTermSet(name, _
    lcid)
public TermSet CreateTermSet(
    string name,
    int lcid
)

Parameters

  • lcid
    Type: System.Int32

    The language that the new TermSet name is in

Return Value

Type: Microsoft.SharePoint.Taxonomy.TermSet
The newly created TermSet

Exceptions

Exception Condition
UnauthorizedAccessException

The current user has insufficient permissions to perform this operation.

TermStoreOperationException

Creating a term set in system Group is disallowed.

ArgumentException

The name parameter is invalid. It either contains invalid characters, is too long, or conflicts with the name of an existing TermSet in the same Group.

ArgumentNullException

The name cannot be null or empty.

ArgumentOutOfRangeException

The lcid is not one of the working languages for the term store

Remarks

The name cannot exceed 255 characters, and it cannot contain any of the following illegal characters: ; " < > | & tab

Additionally the name must be a unique TermSet object name within the current Group object. The current user must have TaxonomyRights.EditTermSet permission to use this method. Call the CommitAll() method to save this change to the database.

See Also

Reference

Group Class

Group Members

CreateTermSet Overload

Microsoft.SharePoint.Taxonomy Namespace

Name

Id

CreateTermSet(String)

CreateTermSet(String, Guid)

CreateTermSet(String, Guid, Int32)