Class TableClass

Namespace
ESRI.ArcGIS.Geodatabase
Assembly
ESRI.Server.Geodatabase.dll
[ClassInterface(ClassInterfaceType.None)]
[Guid("AF10D71C-A61B-11D4-A64C-0008C711C8C1")]
public class TableClass : Table, ITable, IClass, ITableCapabilities, IDataset, IDatasetEdit, IDatasetEditInfo, IDatasetAnalyze, ISchemaLock
Inheritance
TableClass
Implements
Inherited Members

Explicit Interface Implementations

AddField(IField)

virtual void AddField(IField Field)

Parameters

Field IField

AddIndex(IIndex)

virtual void AddIndex(IIndex Index)

Parameters

Index IIndex

AllowableComponents

The allowable components to be analyzed.

virtual int AllowableComponents { get; }

Returns

int

Remarks

The AllowableComponents property indicates which parts of the table or feature class can be analyzed. The returned value is based on the esriTableComponents enumeration. Members from this enumeration can be bitwise or’d together.

Analyze(int)

Analyze the data to update/generate DBMS statistics.

virtual void Analyze(int tableComponents)

Parameters

tableComponents int

Remarks

When applied to a feature dataset, Analyze updates the statistics for all of the tables.

BrowseName

The browse name of the dataset.

virtual string BrowseName { get; set; }

Returns

string

Remarks

BrowseName returns file names without their extension. For example, States.shp would appear as States.

CLSID

virtual UID CLSID { get; }

Returns

UID

CanCopy()

True if this dataset can be copied.

virtual bool CanCopy()

Returns

bool

Remarks

The CanCopy, CanDelete, and CanRename properties are meant to be used in conjunction with the Copy, Delete, and Rename methods and signify whether a dataset is supported by these methods.  For example, you may not delete a network feature class nor can you use the Copy method on a Geodatabase feature class.  To copy Geodatabase datasets, including feature classes, geometric networks, topologies, etc., use the IGeoDBDataTransfer interface.

The CanCopy method is supported by:

  • CAD Drawings
  • Coverages
  • DBase Tables
  • Info Tables
  • Raster Datasets
  • SDC datasets
  • SDC Network Datasets
  • Shapefiles
  • Shapefile Network Datasets

CanDelete()

True if this dataset can be deleted.

virtual bool CanDelete()

Returns

bool

Remarks

The CanCopy, CanDelete, and CanRename properties are meant to be used in conjunction with the Copy, Delete, and Rename methods and signify whether a dataset is supported by these methods.  For example, you may not delete a network feature class nor can you use the Copy method on a Geodatabase feature class.  To copy Geodatabase datasets, including feature classes, geometric networks, topologies, etc., use the IGeoDBDataTransfer interface.

CanEdit

True if the dataset supports edit sessions with the ability to discard edits on save.

virtual bool CanEdit { get; }

Returns

bool

Remarks

This property is to be used within an active edit session, results cannot be guaranteed if called on a dataset outside of an edit session.

CanRedo

True if the dataset supports edit sessions with the ability to redo undone operations.

virtual bool CanRedo { get; }

Returns

bool

CanRename()

True if this dataset can be renamed.

virtual bool CanRename()

Returns

bool

Remarks

The CanCopy, CanDelete, and CanRename properties are meant to be used in conjunction with the Copy, Delete, and Rename methods and signify whether a dataset is supported by these methods.  For example, you may not delete or rename a network feature class nor can you use the Copy method on a Geodatabase feature class.  To copy Geodatabase datasets, including feature classes, geometric networks, topologies, etc., use the IGeoDBDataTransfer interface.

CanSelect

Indicates if the table supports selection.

virtual bool CanSelect { get; }

Returns

bool

Remarks

Use CanSelect to determine if you can open a selection set on the table. A situation where CanSelect will be False is a standalone database table without an OID column.

CanUndo

True if the dataset supports edit sessions with the ability to undo individual edit operations.

virtual bool CanUndo { get; }

Returns

bool

Category

The category of the dataset.

virtual string Category { get; }

Returns

string

Remarks

IDataset::Category returns a description of the category of the dataset.  The description returned from the Category property is the same value that is displayed in the Type column within the Contents tab in ArcCatalog.  The value will contain a description of the dataset such as "Topology" prefixed with a description of the type of workspace containing the dataset such as "File Geodatabase".

The description returned from IDataset::Category may change between releases of ArcGIS. In addition to this, returned strings are localized, meaning that code relying on a specific string being provided may fail when deployed with a different version of ArcGIS than it was developed with, or when deployed to a client using a different language than it was developed with.

ChangeSchemaLock(esriSchemaLock)

Changes a schema lock.

virtual void ChangeSchemaLock(esriSchemaLock schemaLock)

Parameters

schemaLock esriSchemaLock

Remarks

There are two kinds of schema locks: shared and exclusive. Shared schema locks are applied automatically by the geodatabase when accessing a dataset and are removed when all references to the dataset are removed. For this reason, it's not necessary to explicitly apply or remove shared schema locks. There is no limit to the number of shared schema locks a dataset or object can have at any given time.
In contrast to shared schema locks, exclusive schema locks are controlled by the developer or ArcGIS application, such as ArcMap or ArcCatalog. An exclusive lock is used to lock a geodatabase dataset or object from use by others to make the necessary changes to it. An exclusive lock is promoted from a shared lock and demoted back to a shared lock when no longer needed. The presence of additional shared schema locks on a dataset or object prevents an exclusive schema lock from being applied and precludes the ability to make changes to the underlying dataset and its schema while it is in use. Only one exclusive schema lock is allowed per dataset. As opposed to shared schema locks, exclusive schema locks are not applied or removed automatically; it is the responsibility of the developer to apply or remove exclusive schema locks.
Limit the scope of exclusive schema locks to the operation that requires the lock. Gather the necessary information to perform the action, obtain the exclusive lock, make the change, and release the lock. Some examples of operations for which an exclusive schema lock should be obtained include:
  • Modifications to attribute domains, such as adding or removing values from a coded value domain or changing the range for range domains
  • Adding or deleting a field from a feature class or object class
  • Associating a class extension with a feature class
  • Creating a topology, geometric network, network dataset, terrain, schematic dataset, representation, or cadastral fabric on a set of feature classes
  • Any use of the IClassSchemaEdit interface
  • Putting a feature class into and taking it out of load-only mode with the IFeatureClassLoad.LoadOnlyMode method
  • Managing (creating, deleting, or modifying) spatial and attribute indexes
Once the action requiring an exclusive schema lock is complete, the exclusive schema lock must be demoted to a shared lock. This includes when errors are raised during the schema modification, for example, consider the case where a field is being deleted from a feature class. To delete the field, an exclusive schema lock is obtained. However, on the call to DeleteField, an error is thrown; that is, the field being deleted is a required field, such as the ObjectID field. In the handling of the error, the exclusive schema lock must be demoted to a shared lock before proceeding.
 
 

Copy(string, IWorkspace)

Copies this dataset to a new dataset with the specified name.

virtual IDataset Copy(string copyName, IWorkspace copyWorkspace)

Parameters

copyName string
copyWorkspace IWorkspace

Returns

IDataset

Remarks

IDataset::Copy should only be used with datasets from file-based data sources, such as shapefiles and coverages.

CreateRow()

Creates a row in the database with a system assigned object ID and null property values.

virtual IRow CreateRow()

Returns

IRow

Remarks

The CreateRow method creates a new row in the underlying database with a system assigned object id value. A row object representing the created row is returned to the caller. The row object returned has the system assigned object ID as the value of the OIDField. All other fields are initialized to null values if they can be made null and to built-in default values appropriate to the type of the field if they cannot be made null.

The caller is responsible for setting the desired field values into the row and calling the Store method on the row. If the table represents an object class with subtypes, then it is the caller’s responsibility to set the default subtype code into the row and call the InitDefaultValues method on the row before storing, if that is the desired result. For tables without object behavior, insert cursors offer a more efficient way for inserting new rows.

CreateRowBuffer()

Creates a row buffer that can be used with an insert cursor.

virtual IRowBuffer CreateRowBuffer()

Returns

IRowBuffer

Remarks

The CreateRowBuffer method creates a new row buffer object in memory and returns it to the caller. No row is created in the database. The returned row buffer does not have an object ID value. The caller can set values into the row buffer and use it as an argument to the InsertRow method on an insert cursor; the latter is obtained by calling the Insert method on the Table.

Delete()

Deletes this dataset.

virtual void Delete()

Remarks

Certain feature classes, such as network and topology feature classes, cannot be deleted until their containing objects are deleted.

DeleteField(IField)

virtual void DeleteField(IField Field)

Parameters

Field IField

DeleteIndex(IIndex)

virtual void DeleteIndex(IIndex Index)

Parameters

Index IIndex

DeleteSearchedRows(IQueryFilter)

Delete the Rows in the database selected by the specified query.

virtual void DeleteSearchedRows(IQueryFilter QueryFilter)

Parameters

QueryFilter IQueryFilter

EXTCLSID

virtual UID EXTCLSID { get; }

Returns

UID

Extension

virtual object Extension { get; }

Returns

object

ExtensionProperties

virtual IPropertySet ExtensionProperties { get; }

Returns

IPropertySet

Fields

virtual IFields Fields { get; }

Returns

IFields

FindField(string)

virtual int FindField(string Name)

Parameters

Name string

Returns

int

FullName

The associated name object.

virtual IName FullName { get; }

Returns

IName

Remarks

The FullName property returns a Name object for the dataset. The Name object can be persisted and provides a way to get back to the dataset in a future session of the application, via the Open method on the Name object.

GetCurrentSchemaLocks(out IEnumSchemaLockInfo)

The list of current locks.

virtual void GetCurrentSchemaLocks(out IEnumSchemaLockInfo schemaLockInfo)

Parameters

schemaLockInfo IEnumSchemaLockInfo

Remarks

The ISchemaLockInfo interface is used in concert with ISchemaLock to provide information about a schema lock, for example, whether it is shared or exclusive and for ArcSDE geodatabases, the name of the user who has the lock.  Note that there will always be at least one schema lock on the dataset.  Also note that by checking the schema locks on a dataset a shared schema lock is applied to the data. 

GetRow(long)

The row from the database with the specified object ID.

virtual IRow GetRow(long OID)

Parameters

OID long

Returns

IRow

Remarks

The GetRow method returns an existing row object, given its object ID value. The caller can query the returned row object for additional object specific interfaces. The retrieved row may be modified; calling Store on the row object after changing it will trigger messages to related objects and will mark the row for committing to the database.

GetRows(object, bool)

The cursor of rows based on a set of object ids.

virtual ICursor GetRows(object oids, bool Recycling)

Parameters

oids object
Recycling bool

Returns

ICursor

Remarks

The GetRows method returns a cursor that may be used to retrieve a set of rows specified by the input array of object id values. See the description of the Search method to understand the meaning of the recycling parameter. It is far more efficient to retrieve a set of rows using the GetRows method than it is to retrieve each individual row using the GetRow method. The retrieved rows may be modified; Store should be called on the row objects after changing them.

The oids parameter should be passed an integer array. For example:

 

[C#]

// Get a recycling cursor for the OID array.

int[] oidArray = new int[] { 10844, 10853, 10871 };

ICursor cursor = table.GetRows(oidArray, true);

HasOID

virtual bool HasOID { get; }

Returns

bool

IClass_AddField(IField)

Adds a field to this object class.

virtual void IClass_AddField(IField Field)

Parameters

Field IField

Remarks

Prior to adding a new field to a class, an exclusive schema lock should be obtained using the ISchemaLock interface.

Attempting to add a new field that does not allow null values will fail, if the class already has data in it. The only solution is to recreate the class with the non-nullable field, then copy the rows from the original class into the new class.

IClass_AddIndex(IIndex)

Adds an index to this object class.

virtual void IClass_AddIndex(IIndex Index)

Parameters

Index IIndex

Remarks

Prior to adding a new index to a class, an exclusive schema lock should be obtained using the ISchemaLock interface.

IClass_CLSID

The GUID for the COM Class (CoClass) corresponding to instances of this object class.

virtual UID IClass_CLSID { get; }

Returns

UID

IClass_DeleteField(IField)

Deletes a field from this object class.

virtual void IClass_DeleteField(IField Field)

Parameters

Field IField

Remarks

DeleteField removes the specified field from a table, object class or feature class. Fields that are required by the Geodatabase and cannot be removed include:

  • OBJECTID field
  • SHAPE and shape dependent fields such as SHAPE_Length
  • Enabled, AncillaryRole and Weight field for network feature classes
  • Subtype fields. In order to delete a subtype field, it must first be removed as the subtype field, see the help on ISubtypes::SubtypeFieldName

Prior to deleting a field from a class, an exclusive schema lock should be obtained using the ISchemaLock interface.

IClass_DeleteIndex(IIndex)

Deletes an index from this object class.

virtual void IClass_DeleteIndex(IIndex Index)

Parameters

Index IIndex

Remarks

Prior to deleting an index from a class, an exclusive schema lock should be obtained using the ISchemaLock interface.

IClass_EXTCLSID

The GUID for the COM Class (CoClass) corresponding to the class extension for this object class.

virtual UID IClass_EXTCLSID { get; }

Returns

UID

IClass_Extension

The extension for this object class.

virtual object IClass_Extension { get; }

Returns

object

IClass_ExtensionProperties

The extension properties for this object class.

virtual IPropertySet IClass_ExtensionProperties { get; }

Returns

IPropertySet

IClass_Fields

The fields collection for this object class.

virtual IFields IClass_Fields { get; }

Returns

IFields

Remarks

<P>Each table in a database has an ordered collection of fields, there is always at least one field in a table. The ordered collection behaves like a list, so it is possible to access individual fields by a numbered position (or index) in the list.</P> <P>A <STRONG>Fields </STRONG>collection can also exist independently of a table, for example when creating an index on a table you will need to define which fields take part in the index. There are many interfaces which either require or return a <STRONG>Fields </STRONG>collection; these include <STRONG>IClass </STRONG>(therefore also <STRONG>IObjectClass </STRONG>and <STRONG>IFeatureClass</STRONG>), <STRONG>ICursor</STRONG>, <STRONG>IIndex</STRONG>, <STRONG>IFeatureClassDraw</STRONG>, <STRONG>IRowBuffer</STRONG>, <STRONG>ISimpleDataConverter</STRONG>, <STRONG>ITableSort </STRONG>and <STRONG>IValidate</STRONG>.</P>

IClass_FindField(string)

The index of the field with the specified name.

virtual int IClass_FindField(string Name)

Parameters

Name string

Returns

int

Remarks

If FindField returns -1, the Field could not be found in the Fields collection.

Developers working with SDE should be aware of qualified field names and their impact on calls to FindField. For more information, see the IFields2 interface.

IClass_HasOID

Indicates if the class has an object identity (OID) field.

virtual bool IClass_HasOID { get; }

Returns

bool

IClass_Indexes

The indexes collection for this object class.

virtual IIndexes IClass_Indexes { get; }

Returns

IIndexes

Remarks

<P>The <STRONG>Indexes </STRONG>object represents a collection of indexes on a table. Indexes are designed to improve access times to data. The <STRONG>Indexes </STRONG>collection object operates in a very similar way to the Fields collection object.</P>

IClass_OIDFieldName

The name of the field corresponding to the OID.

virtual string IClass_OIDFieldName { get; }

Returns

string

Indexes

virtual IIndexes Indexes { get; }

Returns

IIndexes

Insert(bool)

Returns a cursor that can be used to insert new Rows.

virtual ICursor Insert(bool useBuffering)

Parameters

useBuffering bool

Returns

ICursor

Remarks

The Insert method returns an insert cursor that can be used to bulk insert rows. It offers significantly faster performance than multiple calls to CreateRow and Store for tables storing simple rows and simple features (that is, for tables whose CLSID is esriGeoDatabase.Row, esriGeoDatabase.Object, or esriGeoDatabase.Feature).

Insert cursors on tables containing complex objects use the CreateRow and Store methods to achieve polymorphism, and there is no difference in performance in these cases.

When using cursors within an edit session, they should always be scoped to edit operations. In other words, a cursor should be created after an edit operation has begun and should not be used once that edit operation has been stopped or aborted.

IsBeingEdited()

True if the dataset is being edited.

virtual bool IsBeingEdited()

Returns

bool

Remarks

Once an edit session has been started on a workspace, the IsBeingEdited method on the IDatasetEdit interface can be used to determine if a particular dataset is participating in the edit session.

The reasons why a dataset may not participate include the connected user has no privileges or permission to edit the dataset, the connected user is not licensed to edit this type of dataset, or the dataset is not versioned but a versioned edit session has been started (or vice versa).

Name

The name of the Dataset.

virtual string Name { get; }

Returns

string

OIDFieldName

virtual string OIDFieldName { get; }

Returns

string

PropertySet

The set of properties for the dataset.

virtual IPropertySet PropertySet { get; }

Returns

IPropertySet

Remarks

Examples of intrinsic properties for which explicit methods exist include the SpatialReference and the Extent methods available on the IGeoDataset interface. In most cases this PropertySet will be empty.

IDataset::PropertySet is not supported for Graph objects such as a Geometric Network.

Rename(string)

Renames this Dataset.

virtual void Rename(string Name)

Parameters

Name string

Remarks

IDataset::Rename does not support the renaming of Graph objects such as a Geometric Network.  In addition, certain feature classes, such as network feature classes, cannot be renamed.

RowCount(IQueryFilter)

The number of Rows selected by the specified query.

virtual long RowCount(IQueryFilter QueryFilter)

Parameters

QueryFilter IQueryFilter

Returns

long

Search(IQueryFilter, bool)

An object cursor that can be used to fetch row objects selected by the specified query.

virtual ICursor Search(IQueryFilter QueryFilter, bool Recycling)

Parameters

QueryFilter IQueryFilter
Recycling bool

Returns

ICursor

Remarks

The Search method returns a search cursor that can be used to retrieve rows specified by a query filter. The recycling parameter controls row object allocation behavior. Recycling cursors rehydrate a single 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 row object returned by a recycling cursor across multiple calls to NextRow on the cursor.

Row objects returned by a recycling cursor should not be modified. Non-recycling cursors return a separate row object on each fetch. The objects returned by a non-recycling cursor may be modified and stored with polymorphic behavior. The geodatabase guarantees ‘unique instance semantics’ on non-recycling row objects fetched during an edit session. If the row 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.

Non-recycling feature cursors returned from the Search method *MUST* be used when copying features from the cursor into an insert cursor of another class.  This is because a recycling cursor reuses the same geometry and under some circumstances all of the features inserted into the insert cursor may have the same geometry.  Using a non-recycling cursor ensures that each geometry is unique.

When using cursors within an edit session, they should always be scoped to edit operations. In other words, a cursor should be created after an edit operation has begun and should not be used once that edit operation has been stopped or aborted.

Select(IQueryFilter, esriSelectionType, esriSelectionOption, IWorkspace)

A selection that contains the object ids selected by the specified query.

virtual ISelectionSet Select(IQueryFilter QueryFilter, esriSelectionType selType, esriSelectionOption selOption, IWorkspace selectionContainer)

Parameters

QueryFilter IQueryFilter
selType esriSelectionType
selOption esriSelectionOption
selectionContainer IWorkspace

Returns

ISelectionSet

Remarks

The Select method returns a selection set that holds either row IDs or row objects from the Table depending on the selection option. Multiple selection sets can be created on the same table. It is up to a client application or object to keep a reference on created selections and use them as appropriate. For example, a FeatureLayer creates and uses selections on a FeatureClass (a type of Table).

The selType parameter determines the type of selection set that will be created: an ID set, a snapshot, or a hybrid. See the ISelectionSet interface for a comparison of the three types.

When calling Select the selectionContainer parameter is no longer required. A null value should be passed as this parameter. 

Subsets

Datasets contained within this dataset.

virtual IEnumDataset Subsets { get; }

Returns

IEnumDataset

Remarks

IDataset::Subsets is not supported for Graph objects such as a Geometric Network.  To return the feature classes contained in a Geometric Network, use the IFeatureClassContainer interface.

Type

The type of the Dataset.

virtual esriDatasetType Type { get; }

Returns

esriDatasetType

Remarks

The Type property returns the an esriDatasetType value indicating the dataset type, such as esriDTTable or esriDTFeatureClass.

Update(IQueryFilter, bool)

Returns a cursor that can be used to update Rows selected by the specified query.

virtual ICursor Update(IQueryFilter QueryFilter, bool Recycling)

Parameters

QueryFilter IQueryFilter
Recycling bool

Returns

ICursor

Remarks

The Update method returns an update cursor that can be used to update or delete rows. It offers somewhat faster performance than multiple calls to Store or Delete on row objects fetched using a non-recycling search cursor for tables storing simple rows and simple features. There is no difference in performance for complex objects and features.

When using cursors within an edit session, they should always be scoped to edit operations. In other words, a cursor should be created after an edit operation has begun and should not be used once that edit operation has been stopped or aborted.

UpdateSearchedRows(IQueryFilter, IRowBuffer)

Update the Rows in the database selected by the specified query.

virtual void UpdateSearchedRows(IQueryFilter QueryFilter, IRowBuffer buffer)

Parameters

QueryFilter IQueryFilter
buffer IRowBuffer

Workspace

The workspace containing this dataset.

virtual IWorkspace Workspace { get; }

Returns

IWorkspace

Remarks

<p>A Workspace is a container of spatial and non-spatial datasets such as feature classes, raster datasets, and tables. It provides methods to instantiate existing datasets and to create new datasets. Workspaces are classified into types specified by the <b><a href="esriWorkspaceType.htm">esriWorkspaceType</a></b> enumerator: FileSystemWorkspace, LocalDatabaseWorkspace, and RemoteDatabaseWorkspace. Shapefiles and ArcGIS for Desktop Advanced workspaces are examples of FileSystemWorkspace. A personal geodatabase stored in an Access or a File Geodatabase is an example of a LocalDatabaseWorkspace. A geodatabase stored in an RDBMS such as Oracle, DB2, SQL Server, or Informix and accessed via ArcSDE is an example of a RemoteDatabaseWorkspace.</p> <p>A Workspace hands out a <b><a href="WorkspaceName.htm">WorkspaceName</a> </b>object as the value of its FullName property. For example, the WorkspaceName for a workspace can be persisted in a map document. An application can call the <b>Open()</b> method on the workspace name after loading it from persistent storage to connect to and get an object reference to the workspace.</p>