Is there a way to designate what column is the object ID when creating a standalone table from an oracle database?
When I am creating a standalone table using the StandaloneTableFactory it does not assign a Field as the OBJECT ID type.
using (Geodatabase geodatabase = new Geodatabase(connectionProperties))
using (Table worktable = geodatabase.OpenDataset<Table>(queryTableName))
{
var tableParams = new StandaloneTableCreationParams(worktable)
{
Name = queryTableName,
};
// creates the standalone table.
StandaloneTableFactory.Instance.CreateStandaloneTable(tableParams, MapView.Active.Map);
}
If the standalone table does not have an OBJECT ID it seems to have a tendency to not let the attribute table be viewed once the table is converted to a XY Event Layer.
var uri = standaloneTable.URI;
List<object> arguments = new List<object>
{
// URI of the standalone table to be projected on the map
standaloneTable.URI,
// X Value column
"LON",
// Y Value comlumn
"LAT",
// Where to change the name of the standalone table
tableName,
// Spatial referance 4326 = GCS_WGS_1984 Coordinate system
SpatialReferenceBuilder.CreateSpatialReference(4326),
};
// Takes the standalonetable and makes a XY Event layer
await Geoprocessing.ExecuteToolAsync($"MakeXYEventLayer_management", Geoprocessing.MakeValueArray(arguments.ToArray()));
Now If I got to the database in the catalog view and then just drag the table in to the MapView it creates the standalone table with a column with unique values as the OBJECT ID, thus allowing the XY Event Layer to be created and its attribute layer visible.