Select to view content in your preferred language

Get broken sde datasource name

1956
2
12-16-2014 09:00 PM
prashantk
Occasional Contributor

Hi All,

I am trying to change sde datasource using arcobject.If SDE connection is working then i can retrieve datasource name using IDataLayer interface.

IDataLayer dataLayer = (IDataLayer)sourceLyr;

               

IName dsName= dataLayer.DataSourceName;

But if connection is broken(red mark in TOC layer) then datasource is returning null value. My datasource name and layer name in TOC is different.

How to retrieve broken dataset name? Any help would be appreciated.

0 Kudos
2 Replies
MuhammadAttique
Regular Contributor

Hi prashant k,

How you update the connection, when MXD open,

or try to disconnect first and then connect to restore the connection - update it and call IApplication to savedocument.

or you can visit ESRI's help link , may be helpful for you .

ArcGIS Desktop   http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s30000004p000000

0 Kudos
prashantk
Occasional Contributor

Hi Muhammad,

I am trying to achieve this using arcobjeci api.I have created customized tool to find and replace sde connection for existing layer and this should work if connection is not present in arc catalog.

Either connection is not available you can see details in layer properties.I am trying to get this details using api but no success..

0 Kudos