Gets the value from the geodatabase-managed column which uniquely identifies the Row. Typically this is value stored in the OBJECTID column for geodatabase tables/feature classes, the FID column for shapefiles and OID column for dBase tables.

Namespace:  ESRI.ArcGISExplorer.Data

Assembly:  ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)

Syntax

C#
public int ObjectID { get; }
Visual Basic (Declaration)
Public ReadOnly Property ObjectID As Integer

Field Value

The unique value used to identify the Row in the Table. This property only applies when HasObjectIDColumn is true.

Remarks

This is a convenience property which avoids the need to access the unique identifier column in the RowValueCollection by name or index position.

Examples

The code below returns an individual record from a file geodatabase feature class then accesses the Row object properties including the unique identifier value stored in the OBJECTID column.
CopyC#
//Open Montgomery file geodatabase
Geodatabase gdb = new Geodatabase(@"C:\Data\Montgomery.gdb");

//Open the parcels featureclass
Table parcels = gdb.OpenTable("parcels");

//Get a single parcel by property ID
Row row = parcels.Search(new Filter("PROPERTY_I = 4704")).GetFirst();

//Print out some properties of the row
System.Diagnostics.Debug.Print(row.HasObjectIDColumn.ToString());   //Prints "True"
System.Diagnostics.Debug.Print(row.ObjectID.ToString());            //Prints "3704"
System.Diagnostics.Debug.Print(row.Table.Name);                     //Prints "parcels"

//Get the area of this parcel
System.Diagnostics.Debug.Print(row.Values[parcels.Columns.AreaColumnName].ToString()); //Prints "12815.4"

//Return the geometry of the parcel from the row
Polygon poly = row.Geometry as Polygon;

//Call ToString() on the polygon to print summary geometry information
System.Diagnostics.Debug.Print(poly.ToString());    //Prints "Polygon: Point count = 7 Ring count = 1"

//Get the area of this parcel from the geometry
System.Diagnostics.Debug.Print(poly.Area.ToString());               //Prints "12815.4"
CopyVB.NET
'Open Montgomery file geodatabase
Dim gdb As Geodatabase = New Geodatabase("C:\Data\Montgomery.gdb")

'Open the parcels featureclass
Dim parcels As Table = gdb.OpenTable("parcels")

'Get a single parcel by property ID
Dim r As Row = parcels.Search(New Filter("PROPERTY_I = 4704")).GetFirst()

'Print out some properties of the row
System.Diagnostics.Debug.Print(r.HasObjectIDColumn.ToString())   'Prints "True"
System.Diagnostics.Debug.Print(r.ObjectID.ToString())            'Prints "3704"
System.Diagnostics.Debug.Print(r.Table.Name)                     'Prints "parcels"


'Get the area of this parcel
System.Diagnostics.Debug.Print(r.Values.Item(parcels.Columns.AreaColumnName).ToString()) 'Prints "12815.4"


'Return the geometry of the parcel from the row
Dim poly As Polygon = r.Geometry

'Call ToString() on the polygon to print summary geometry information
System.Diagnostics.Debug.Print(poly.ToString())    'Prints "Polygon: Point count = 7 Ring count = 1"


'Get the area of this parcel from the geometry
System.Diagnostics.Debug.Print(poly.Area.ToString())             'Prints "12815.4"

See Also