Select a feature by attribute table field and highlight on map

Aug 28, 2014 at 8:18 PM
Hi every one,
Sorry for my noob questions.I use this code to select a feature with attribute but it does not work at all.where is my mistake?can you please help me with this/
             List<IFeature> resultS =new List<IFeature>();
            ((IFeatureLayer)map1.Layers[0]).SelectByAttribute("[id] = 1");
       
and also this one does not work
      resultS = iFeatureSet.SelectByAttribute("[id] =1");
Nov 14, 2014 at 6:47 AM
hi try this

DirectCast(Map1.Layers(0), IFeatureLayer).SelectByAttribute([id] =1)