Get Route Event Layer Source Table Name

669
1
Jump to solution
02-22-2013 07:21 AM
BryanBoutz1
New Contributor III
I have a Desktop Add-In built with C# that provides additional UI for working with some route event data.  I want to ensure the user interaction between the map layers and the underlying data table stays connected, even if the layer name gets changed.  I also want to guaranty that the correct event layer is in the map.

So the question is, given a Route Event Layer, how do I use ArcObjects to access the underlying table?  Specifically, how do I get its name in the database?
0 Kudos
1 Solution

Accepted Solutions
BryanBoutz1
New Contributor III
I figured out the basic technique, now I need to work it up properly for my application.

The steps I figured out:
1. Cast Carto.ILayer object to a Geodatabase.IDataset object.
2. Get the IDataset.FullName, which is an IName object
3. Cast the IName object to Geodatabase.IRouteEventSourceName
4. Get the IRouteEventSourceName.EventTableName, which is an IName object
5. Cast the IName object to an IDatasetName object
6. Retrieve the Name string.

((ESRI.ArcGIS.Geodatabase.IDatasetName)((ESRI.ArcGIS.Geodatabase.IRouteEventSourceName)((ESRI.ArcGIS.Geodatabase.IDataset)layer).FullName).EventTableName)

View solution in original post

1 Reply
BryanBoutz1
New Contributor III
I figured out the basic technique, now I need to work it up properly for my application.

The steps I figured out:
1. Cast Carto.ILayer object to a Geodatabase.IDataset object.
2. Get the IDataset.FullName, which is an IName object
3. Cast the IName object to Geodatabase.IRouteEventSourceName
4. Get the IRouteEventSourceName.EventTableName, which is an IName object
5. Cast the IName object to an IDatasetName object
6. Retrieve the Name string.

((ESRI.ArcGIS.Geodatabase.IDatasetName)((ESRI.ArcGIS.Geodatabase.IRouteEventSourceName)((ESRI.ArcGIS.Geodatabase.IDataset)layer).FullName).EventTableName)