ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / StandaloneTable Class / SetDefinitionQuery Method
A where clause that conforms to SQL standard to filter records.

In This Topic
    SetDefinitionQuery Method (StandaloneTable)
    In This Topic
    Sets the where clause of the active definition query. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public DefinitionQuery SetDefinitionQuery( 
       string whereClause
    )
    Public Function SetDefinitionQuery( _
       ByVal whereClause As String _
    ) As DefinitionQuery

    Parameters

    whereClause
    A where clause that conforms to SQL standard to filter records.

    Return Value

    A DefinitionQuery object.
    Exceptions
    ExceptionDescription
    This method cannot be called if the feature layer is a member of SubtypeGroupLayer. Use the IsSubtypeLayer property to determine if the feature layer is a member of a SubtypeGroupLayer.
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Remarks
    If the whereClause is null or empty string, then the active query definition is removed and the layer no longer has an active definition query.Where there is an active definition query, this function updates the where clause of tha definition query with the whereClause you pass in.If the whereClause is non-null, and there is no active definition query, a new definition query with the specified where clause is created and becomes the active definition query. An auto generated name gets assigned. All other definition queries that are not active remain unchanged.Use SetActiveDefinitionQuery to activate or deactive any existing definition query.
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also