The feature class is a personal geodatabase featureclass, I'm not dealing with SDE featureclasses so unfortunately your second post doesn't apply, but thanks for looking into this.
Public Function GetPathForALayer(ByVal layer As ESRI.ArcGIS.Carto.ILayer) As System.String If layer Is Nothing OrElse Not (TypeOf layer Is ESRI.ArcGIS.Geodatabase.IDataset) Then Return Nothing End If Dim dataset As ESRI.ArcGIS.Geodatabase.IDataset = CType(layer, ESRI.ArcGIS.Geodatabase.IDataset) ' Explicit Cast Return (dataset.Workspace.PathName & "\" & dataset.Name) End Function
I have a frustrating unpredictable situation where for some reason (which I have yet discovered the reason) when I call IWorkspace.PathName I get an empty string. I am solely dealing with personal GDB feature classes - no remote database workspaces involved. I initially thought it was down to the fact that I had a large number of layers loaded in my TOC all located in my PGDB, so removed all of the unnecessary layers before calling the code. This appears to sort the problem for 99% of the time, but hasn't solved it completely. I'm running 9.3 on XP (32 and 64-bit) and get the empty string returned on both platforms. I've noticed users finding this occurring with SDE databases but not with PGDBs - has anyone experienced this?ThanksJames
For i = 0 To pMap.LayerCount - 1 'get the pathName of the pMap.Layer(i) Next
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.