I want to select a feature from a FeatureLayer using a query and I can't find any example of it.
The closest code snippet I have found uses somekind of selection by intersection, but that is not going to work for me:
Dim qf As QueryFilter = New QueryFilter()
qf.WhereClause = "Filed1= " & myVariable
Using rowCursor As RowCursor = fEdif.Search(qf)
Dim feature1 As Feature = TryCast(rowCursor.Current, Feature)
Dim geo As ArcGIS.Core.Geometry.Geometry = feature1.GetShape()
That way the building I want is selected, but also the ones that are attached to it.
So, how can I just select the feature that is returned by the search?
The FeatureLayer has a method called SetSelection, but I can't find any example of how to use it.
Thanks for any help provided!!
Solved! Go to Solution.