Access Connection Properties of SDE Standalone Table

Discussion created by mvolz47 on Jun 11, 2013
Latest reply on Jun 11, 2013 by mvolz47
To All ArcObjects Developers:

I am writing an Add_In to change the properties of a standalone SDE table in ArcMap.

I have the following code that I thought would get the connection properties, but it keeps crashing the Add-In.

pStndAloneTbl = pTableColl.StandaloneTable(k)

'Instantiate the property set object
pPropset = New PropertySet

pDataLayer2 = pStndAloneTbl

pDatasetName2 = pDataLayer2.DataSourceName
pWorkSpaceName2 = pDatasetName2.WorkspaceName

pPropset = pWorkSpaceName2.ConnectionProperties

The code crashes at pDatasetName2 = pDataLayer2.DataSourceName even though Intellisense tells me that the DataSourceName
method is available from the pDataLayer2 object.

Can anyone please tell me what I am doing wrong here as it seems to me like this code should work?

Any help or hints are greatly appreciated.