vgreen_geoseis.ca

Get full path of layer (including file name and extension) in c#

Discussion created by vgreen_geoseis.ca on Dec 2, 2013
Latest reply on Dec 3, 2013 by vgreen_geoseis.ca
Hi,
I have been struggling for a long time now trying to replicate the functionality of the python code: lyr.dataSource where lyr is a layer in the map.
This returns something like:
\\Data\lakes.sdc\lakes for a GD
\\Data\lakes.shp for a shapefile
\\Data\lakes.jpg for a image
etc.

I have followed this example: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//004900000092000000
However the following code:
Return (dataset.Workspace.PathName & "\" & dataset.Name)
Does NOT return what I need.  The .pathName returns the path which is fine but the .Name is the Layers DISPLAY name (what it is called in the map.  It is NOT the name of the source file and does not include the file extension.

So what object and property will return the source file name?

Thanks,
Vera

Outcomes