This document is archived and information here might be outdated.  Recommended version.

IFeatureWorkspace.OpenFeatureClass Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Geodatabase > ESRI.ArcGIS.GeoDatabase > Interfaces > IF > IFeatureWorkspace Interface > IFeatureWorkspace.OpenFeatureClass Method
ArcGIS Developer Help

IFeatureWorkspace.OpenFeatureClass Method

Opens an existing feature class.

[Visual Basic .NET]
Public Function OpenFeatureClass ( _
    ByVal Name As String _
) As IFeatureClass
public IFeatureClass OpenFeatureClass (
    string Name
HRESULT OpenFeatureClass(
  BSTR Name
Name [in]

Name is a parameter of type BSTR

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.


The OpenFeatureClass method can be used to open any existing feature class in the workspace given its fully qualified name. Note that every feature class in a geodatabase has a unique fully qualified name, and the OpenFeatureClass method can be used to directly open feature classes that are part of a feature dataset (the feature dataset name does not need to be specified).

Use the IDatabaseConnectionInfo interface to determine the User and Database (if applicable).  ISQLSyntax::QualifyTableName can be used to determine the fully qualified name for a feature class.  Use the NameExists method on the IWorkspace2 interface to determine if a feature class with the appropriate name exists in a geodatabase.

Opening a feature class that participates in a topology or geometric network will also open all other feature classes participating in the topology or geometric network in memory.

Some examples of how to use the Name parameter of OpenFeatureClass are shown below:

For Coverage feature classes:
For Oracle feature classes (the owner prefix is unnecessary if you are connected as the owner of the feature class):
For SQLServer feature classes:
For Informix feature classes:
For VPF feature classes:
ks032193:veg:vgfarea (library:coverage:feature class)
The library name for VPF data is case sensitive and must appear as it is stored in the LAT (Library Attribute Table)
The 4 tables associated with a Topology; T_#_DirtyAreas, T_#_PolyErrors, T_#_LineErrors and T_#_PointErrors cannot be directly edited. For this reason they cannot be opened and will fail with a general Geodatabase error.

See Also

IFeatureWorkspace Interface | IDatabaseConnectionInfo Interface

.NET Samples

Closest facility solver Buffer snap agent Cut polygons without selection edit task Edit event listener Managing snap agents Custom reshape polyline edit task Custom vertex editing commands 3D dynamic element tracking Location-allocation solver Origin-destination cost matrix solver Route layer RSS weather GraphicTracker RSS weather layer Service area solver Simple point plug-in data source Vehicle routing problem solver