ISelectionSet Interface

Provides access to members that manage a set of selected table rows or features.

Members

Name Description
Method Add Adds an object id to the selection set.
Method AddList Adds a list of object id's to the selection set.
Method Combine Combines this selection set with another selection set using the specified set operation.
Read-only property Count The number of oids in the selection set.
Read-only property FullName The full name of the selection set.
Read-only property IDs Enumerates the object ids in the selection set.
Method MakePermanent Makes the SelectionSet permanent. By default SelectionSets are deleted when released.
Method Refresh Refreshes the state of a snapshot selection.
Method RemoveList Removes a list of object id's from the selection set.
Method Search Returns a cursor that can be used to retrieve the objects specified by a query over this selection set.
Method Select Returns a new selection That contains the object ids selected by a query over this selection set.
Read-only property Target The Table or FeatureClass over which the selection set is defined.

ISelectionSet.Add Method

Adds an object id to the selection set.

Public Sub Add ( _
    ByVal OID As Long _
)
public void Add (
    long OID
);

ISelectionSet.AddList Method

Adds a list of object id's to the selection set.

Public Sub AddList ( _
    ByVal Count As Long, _
    ByRef OIDList As Int64& _
)
public void AddList (
    long Count,
    ref Int64& OIDList
);

Remarks

This method should not be called by .NET or Java applications. Instead, call IGeoDatabaseBridge2.AddList.

This method should not be used in .NET. Instead, use IGeoDatabaseBridge2.AddList.
This method should not be used in .NET. Instead, use IGeoDatabaseBridge2.AddList.

ISelectionSet.Combine Method

Combines this selection set with another selection set using the specified set operation.

Public Sub Combine ( _
    ByVal otherSet As ISelectionSet, _
    ByVal setOp As esriSetOperation, _
    ByRef resultSet As ISelectionSet _
)
public void Combine (
    ISelectionSet otherSet,
    esriSetOperation setOp,
    ref ISelectionSet resultSet
);

Remarks

Used to combine to SelectionSets. The resultSet parameter must be a third selection set and not any of the ones that are combined. For example, if you want to combine A and B and put the result in A, you must combine A and B into C, and then set A to C.

To combine two selection sets, the sets must be derived from the same table or feature class. Attempting to combine selection sets from different datasets will raise an error.

ISelectionSet.Count Property

The number of oids in the selection set.

Public ReadOnly Property Count As Long
public long Count {get;}

ISelectionSet.FullName Property

The full name of the selection set.

Public ReadOnly Property FullName As IName
public IName FullName {get;}

Remarks

The FullName property has not been implemented.

ISelectionSet.IDs Property

Enumerates the object ids in the selection set.

Public ReadOnly Property IDs As IEnumIDs
public IEnumIDs IDs {get;}

ISelectionSet.MakePermanent Method

Makes the SelectionSet permanent. By default SelectionSets are deleted when released.

Public Sub MakePermanent ( _
)
public void MakePermanent (
);

Remarks

This method is not currently implemented.

ISelectionSet.Refresh Method

Refreshes the state of a snapshot selection.

Public Sub Refresh ( _
)
public void Refresh (
);

ISelectionSet.RemoveList Method

Removes a list of object id's from the selection set.

Public Sub RemoveList ( _
    ByVal Count As Long, _
    ByRef OIDList As Int64& _
)
public void RemoveList (
    long Count,
    ref Int64& OIDList
);

Description

Removes a list of OID's from a selection set.The Count parameter represents the number of elements to remove and the OIDList is a pointer to an array of feature IDs.

Remarks

This method should not be called by .NET or Java applications. Instead, call IGeoDatabaseBridge2.RemoveList.

ISelectionSet.Search Method

Returns a cursor that can be used to retrieve the objects specified by a query over this selection set.

Public Sub Search ( _
    ByVal QueryFilter As IQueryFilter, _
    ByVal Recycling As Boolean, _
    ByRef Cursor As ICursor _
)
public void Search (
    IQueryFilter QueryFilter,
    bool Recycling,
    ref ICursor Cursor
);

Remarks

Searchwill return an ICursor with all of the rows that satisfy the constraints specified by a query filter. If a null value is provided for the QueryFilter parameter, the cursor will contain all of the selection set's rows.

The Recycling__parameter controls row object allocation behavior.

Recycling cursors rehydrate a single feature/row object on each fetch and can be used to optimize read-only access, for example, when drawing. It is illegal to maintain a reference on a feature/row object returned by a recycling cursor across multiple calls to NextRowon the cursor. Feature/Row****objects returned by a recycling cursor should not be modified. Non-recycling cursors return a separate object on each fetch.

The features/rows returned by a non-recycling cursor may be modified and stored with polymorphic behavior. The geodatabase guarantees "unique instance semantics" on non-recycling feature/row objects fetched during an edit session. If the object to be retrieved by a call to search has already been instantiated and is being referenced by the calling application, then a reference to the existing row object is returned.

ISelectionSet.Select Method

Returns a new selection That contains the object ids selected by a query over this selection set.

Public Function Select ( _
    ByVal QueryFilter As IQueryFilter, _
    ByVal selType As esriSelectionType, _
    ByVal selOption As esriSelectionOption, _
    ByVal selectionContainer As IWorkspace _
) As ISelectionSet
public ISelectionSet Select (
    IQueryFilter QueryFilter,
    esriSelectionType selType,
    esriSelectionOption selOption,
    IWorkspace selectionContainer
);

Description

Selectwill return a new selection set. This subset of the original selection set will contain all of the rows that satisfy the attribute and/or spatial constraints as specified by the IQueryFilter object. If a null value is passed as the QueryFilter parameter, the new selection set will contain all of the rows from the original selection set.

When calling Select, the selectionContainer parameter is no longer needed; a null value can be provided.

ISelectionSet.Target Property

The Table or FeatureClass over which the selection set is defined.

Public ReadOnly Property Target As ITable
public ITable Target {get;}

Remarks

The Target property returns a reference to the Table or Feature Class from which the Selection Set was constructed.

Classes that implement ISelectionSet

Classes Description
RelQueryTableSelectionSet Esri RelQueryTable Selection object.
SelectionSet Esri Selection Set object.

Remarks

A SelectionSet is used to reference a set of rows or features. This can be used to retrieve, process and select rows or features.

A SelectionSet can be obtained from IFeatureClass::Select or ITable::Select.

If you want to obtain a selection set on a feature layer it is good practice to cast the layer to the ITable interface then use the ITable::Select method. The table that you will obtain this way will mirror the content of the layer even if it has a definition query or a join.

The IFeatureSelection interface contains a SelectionSet property which can be used to access or set the selection on a feature layer. If trying to set the selection with this property you must make sure that the content of the selection set is compatible with the features currently in the layer. It is usually simpler to use IFeatureSelection::SelectFeatures instead.

Selection sets are also used in a number of other interfaces dealing with the selection: ITableSort, IFeatureSelection, ITableSelection, ISelectFeaturesOperation, to name a few.

There are three types of selection sets: ID sets, snapshots, and hybrids. A selection set's type is determined at creation time (for example, by the selType parameter of the IFeatureClass.Select method).

  • ID sets are persisted as a list of Object IDs. When a row is requested from this type of selection set, the row is retrieved from the source table. This guarantees the most current version of the row will be retrieved.
  • Snapshots are a cache of in-memory row objects. Snapshots will always contain the version of the row as it was when the selection was made.
  • Hybrids determine how they are stored based on their current size. Initially, they behave as snapshots, but if they grow beyond a certain point, they will behave like ID sets. Hybrids can be used when the usage pattern isn't dependent on whether the newest version or an older version of a row will be used.

Two of the methods defined by this interface should not be used in .NET or Java applications - AddList and RemoveList. See the IGeoDatabaseBridge2 interface for interop-safe alternatives.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.