ArcObjects Library Reference (GeoDatabase)  

IFeatureWorkspace.OpenFeatureClass Method

Opens an existing feature class.

[Visual Basic .NET]
Public Function OpenFeatureClass ( _
    ByVal Name As String _
) As IFeatureClass
[C#]
public IFeatureClass OpenFeatureClass (
    string Name
);
[C++]
HRESULT OpenFeatureClass(
  BSTR Name,
  IFeatureClass** FeatureClass
);
[C++]

Parameters

Name [in]   Name is a parameter of type BSTR FeatureClass [out, retval]

  FeatureClass is a parameter of type IFeatureClass

Product Availability

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

Remarks

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:
buildings:polygon
For Oracle feature classes (the owner prefix is unnecessary if you are connected as the owner of the feature class):
gdb.Buildings
For SQLServer feature classes:
fdo_data.gdb.Buildings
For Informix feature classes:
bladetest2:gdb.Buildings
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