public bool IsObjectIDMappedColumnRequired()
Public Function IsObjectIDMappedColumnRequired() As Boolean
public bool IsObjectIDMappedColumnRequired()
Public Function IsObjectIDMappedColumnRequired() As Boolean
| Exception | Description |
|---|---|
| ArcGIS.Core.Data.Exceptions.GeodatabaseException | A database-related exception has occurred. |
In order for a database table to behave normally, it needs to have an ObjectID column (or a column of some other name) whose type is either FieldType.SmallInteger or FieldType.IntegerAND that the type must be non-nullable. However, there are situations in which such a column does not exist. Consider the example of a query layer-based QueryDescription object whose GetQueryStatement does not include such a column in its selection list. In such a situation, in order for IsObjectIDMappedColumnRequired to be true, one of the following two cases must be true.
1) There is only one non-nullable field whose type is either FieldType.String, FieldType.Date or FieldType.GUID.
2) There are more than one non-nullable fields whose type is either FieldType.SmallInteger, FieldType.Integer, FieldType.String, FieldType.Date or FieldType.GUID.
Furthermore, beware of IsObjectIDMappedColumnRequired returning false. If this method returns false ANDGetObjectIDField returns an empty string, it is most likely the fields on the selection list in GetQueryStatement are either nullable and/or they are not of type FieldType.SmallInteger, FieldType.Integer, FieldType.String, FieldType.Date, or FieldType.GUID. When this situation occurs, calling Database.OpenTable will cause an exception unlessSetObjectIDFields is invoked first with one or more valid fields as arguments.
Target Platforms: Windows 11, Windows 10