ArcObjects Library Reference  (GeoDatabase)    

IRow.HasOID Property

Indicates if the row has an OID.

[Visual Basic 6.0]
Property HasOID As Boolean
[Visual Basic .NET]
Public ReadOnly Property HasOID As Boolean
[C#]
public bool HasOID {get;}
[Java]
public  getHasOID (
    boolean HasOID
)
[C++]
HRESULT get_HasOID(
  VARIANT_BOOL* HasOID
);
[C++]

Parameters

HasOID [out, retval]

  HasOID is a parameter of type VARIANT_BOOL

Product Availability

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

Remarks

If the table has been registered with the geodatabase it will have unique Object ID, automatically created by the register tool, and the HasOID property will be set to True. Tables not registered with the geodatabase will not have an OID column and the HasOID property will be set to False.  See the IClassSchemaEdit::RegisterAsObjectClass method for more information.

[C#]

    public void IRow_get_HasOID(IRow row)
    {
        //check if a row has an OID
        if (row.HasOID)
        {
            // do something...
            Console.WriteLine("The row has an OID of {0}", row.OID);
        }
    }

[Visual Basic 6.0]
' check if a row has an OID
if pRow.HasOID then
  ' do something...
endif

See Also

IRow Interface