Quote (Mangina @ Feb 19 2015 01:31pm)
Honestly not sure, like i said ive only just started using it with the arcgis sdk. Ill take a look when i get home. Can you explain why?
What i mean was more along the lines of definitionquery = "category = " & categoryCode where categoryCode was an int
This is the actual code I was trying to remember. No errors as of now without options strict
Code
Private Sub setDefinitionQuery(ByVal categoryCode As Integer)
Dim pSelectedLayer As ILayer = getLayerByName(cmbLayers.SelectedItem.ToString)
'this can give an error if pSelectedLayer is not a feature layer
Dim pFLayerDef As IFeatureLayerDefinition = pSelectedLayer
pFLayerDef.DefinitionExpression = "CATEGORY = " & categoryCode
Dim pMxDoc As IMxDocument = _application.Document
pMxDoc.UpdateContents()
pMxDoc.ActiveView.Refresh()
End Sub
This post was edited by Mangina on Feb 19 2015 07:57pm