1

I have a need to get the user value from a layer properties.

The value is from: Layer Properties -> Source -> user in Data Source (sorry not enough score to attach the picture).

I tried to check the ILayerProperties, but haven't found the method related to the user value.

Anybody has the experience?

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Jun 22, 2015 at 9:46
2
  • What is the data source? If I load a shapefile I do not see a "user" property in the data source of layer in ArcMap. Commented Jun 22, 2015 at 10:53
  • Hi Hornbydd, the data is from ArcSDE geodatabase, thanks. Commented Jun 23, 2015 at 3:33

1 Answer 1

4

I think you are asking for the username of a layer's SDE connection. You need to use IWorkspace and IPropertySet. Something like this:

Dim pDataset As IDataset = the feature layer/raster layer you want the user name of
Dim pWorkspace As IWorkspace = pDataset.Workspace
Dim pPropertySet As IPropertySet = pWorkspace.ConnectionProperties
Dim userName As String = pPropertySet.GetProperty("USER")

IPropertySet essentially gives you a dictionary of the properties and their values. If you need to get all the properties or all the values you can put them into arrays:

Dim propertyNames() = Nothing
Dim propertyValues() = Nothing
pPropertySet.GetAllProperties(propertyNames, propertyValues)
answered Jun 22, 2015 at 15:18
0

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.