Hi,
I am trying to read data from a FileGeoDatabase which has related tables (i.e. tables that are created purely as related tables in ARC and do not contain geometry data) - executing GetTableNames returns both the names of normal shape/attribute tables and also related tables. Running GetAllFeatures on the normal tables returns features as expected, and running GetAllFeatures on the related tables returns nothing.
Is there a way of navigating this table / related table structure and finding the data which is linked to shapes in the normal tables?
Thanks,
Jeremy
FileGeoDatabase related tables
Hi Jeremy,
Please try the code as following to query related tables:
DataTable table = geoDatabaseFeatureLayer1.FeatureSource.ExecuteQuery(
"select * from zvalues"
);
If you have any new requirements, could you please attached a demo here? Including the data you are using.
Regards,
Johnny
Hi Johnny,
I tried using ExecuteQuery("select * from " + tablename) and it produces the same result on the main geometry table (it doesnt show the linked attributes) and when I run the execute on the linked table it produces an Esri.FileGDB.FileGDBException with message “An expected Field was not found or could not be retrieved properly.”. I tried running “select * from zvalues” in case that was some magic-word but get “the table was not found”.
I should perhaps mention that the related tables do not have a 1:1 relationship to the main table (it’s n:1 related:main).
I have created a small c# solution which includes a geodatabase in the debug folder that demonstrates how some tables are related…
I am also trying to work out how to determine the projection details of the features in ThinkGeo (I just see null where I would expect to see this information).
Thanks
Jeremy
GeoDatabaseTest.zip (1.91 MB)
Hi Jeremy,
It’s proved to be a bug which has been fixed in the latest version, please get the latest MapSuiteUnmanagedDependency.msi at ap.thinkgeo.com:5001/fbsharing/mKuvUkke to have a try.
Regards,
Johnny
Hi Johnny,
thanks for getting that fixed, I can now see the attributes within these related tables!
Is there any way of finding out which tables are related, and by which field? And is there any way of finding the projection information for features in a FileGeoDatabase?
Thanks
Jeremy
Hi Jeremy,
Sorry that we don’t have this feature now, but I have entered it into our internal task list, and will focus on it when any free time in future. It’s not a short time task, I guess. If it’s urgent for you, please contact support@thinkgeo.com for a support.
Thanks,
Johnny
Hi Johnny,
OK thanks - I will contact support if it becomes a priority for me!
Thanks
Jeremy
Hi Jeremy,
Sorry for inconvenience. Any questions please feel free to let us know.
Thanks,
Johnny