0

In ArcCatalog we can register a table in the GeoDatabase using the tables context menu. Now i'm trying to find a way with ArcObjects, to detect whether an ITable is already registered, is this even possible?

I'm aware that registered tables are listed in the GDB_ITEMS system table, but some SDE connections do not have read access to this table, or only with a different (unknown) qualifier. So reading the system table directly is not an option in this case.

4
  • 1
    I assume if it IS an IFeatureClass or an IObjectClass the table already is registered. I´m not sure if this also applies to ITable. Oct 28, 2015 at 12:23
  • @HimBromBeere - You are right, an IFeatureClass is always registered. So the question should be about ITable objects, in a test i found out, that it is possible to do a successful QueryInterface to IObjectClass even if the table is not registered. Oct 28, 2015 at 12:31
  • Really? Oooh, and what happens if you query the interface for ITable? Oct 28, 2015 at 12:37
  • @HimBromBeere - The test lists all datasets of the workspace. The unregistered IDataset is a standalone table and can then be query-interfaced to ITable as well as to IObjectClass and others like IClass, IClassEx, IClassID, ... Oct 28, 2015 at 12:43

1 Answer 1

2

Finally, with a bit of luck, i found the answer myself. There is an interface IFeatureWorkspaceManage which is supported by feature workspaces, and there we can ask for this information.

IDataset dataset = ...;
IFeatureWorkspaceManage workspaceManage = dataset.Workspace as IFeatureWorkspaceManage;
bool isRegistered = false;
if (workspaceManage != null)
  isRegistered = workspaceManage.IsRegisteredAsObjectClass(dataset.Name);

To register an unregistered table we can use:

IClassSchemaEdit.RegisterAsObjectClass()
2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.