# Layers.Selects()

**URL:** <https://community.thinkgeo.com/t/layers-selects/119>\
**Category:** WinForms\
**Created:** [November 26, 2008, 4:55am UTC](https://community.thinkgeo.com/t/layers-selects/119 "2008-11-26T04:55:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![charly17101983](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/c/3ec8ea/32.png) [@charly17101983](https://community.thinkgeo.com/u/charly17101983)\
**Post date:** [November 26, 2008, 4:55am UTC](https://community.thinkgeo.com/t/layers-selects/119/1 "2008-11-26T04:55:02Z")

</div>

I&nbsp;have&nbsp;another&nbsp;problem&nbsp;with&nbsp;the&nbsp;new&nbsp;version.

In&nbsp;the&nbsp;last&nbsp;version&nbsp;i&nbsp;can&nbsp;"select"&nbsp;a&nbsp;feature&nbsp;with&nbsp;this&nbsp;code:

Dim&nbsp;Pinteres&nbsp;As&nbsp;New&nbsp;Layer(Module1.getRuta&nbsp;&&nbsp;"\Mapas\espes2\_\_\_\_\_\_\_\_pi.shp")

Dim&nbsp;color&nbsp;As&nbsp;GeoColor&nbsp;=&nbsp;GeoColor.FromArgb(200,&nbsp;255,&nbsp;69,&nbsp;0)  
  
Dim&nbsp;brush&nbsp;As&nbsp;New&nbsp;GeoSolidBrush(color)  
  
Dim&nbsp;symbol&nbsp;As&nbsp;New&nbsp;PointSymbol(PointStyleEnum.Circle,&nbsp;brush,&nbsp;8)

Pinteres.SelectSymbols.Clear()  
  
Pinteres.SelectSymbols.Add(symbol)

---------

Sql&nbsp;=&nbsp;"select&nbsp;\*&nbsp;from&nbsp;espes2\_\_\_\_\_\_\_\_pi&nbsp;where&nbsp;ID&nbsp;=&nbsp;3"  
  
Dim&nbsp;selects&nbsp;As&nbsp;Integer()&nbsp;=&nbsp;map1.Layers("espes2\_\_\_\_\_\_\_\_pi").SQLQuery(Sql,&nbsp;"RecID")  
  
map1.Layers("espes2\_\_\_\_\_\_\_\_pi").Selects(selects)

But&nbsp;now&nbsp;I&nbsp;can't&nbsp;do&nbsp;it&nbsp;with&nbsp;the&nbsp;class&nbsp;ShapeFileFeatureLayer.&nbsp;Any&nbsp;ideas?  
  
Thanks!!

Carlos  
  
&nbsp;

---

<div class="post-metadata">

**Author:** ![Ben](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ben/32/25720_2.png) [@Ben](https://community.thinkgeo.com/u/Ben)\
**Post date:** [November 27, 2008, 12:22am UTC](https://community.thinkgeo.com/t/layers-selects/119/2 "2008-11-27T00:22:36Z")

</div>

Carlos,

In&nbsp;3.0,&nbsp;you&nbsp;can&nbsp;get&nbsp;the&nbsp;same&nbsp;function&nbsp;by&nbsp;using&nbsp;InMemoryLayer.&nbsp;Here&nbsp;attached&nbsp;is&nbsp;the&nbsp;sample&nbsp;code&nbsp;as&nbsp;well&nbsp;as&nbsp;a&nbsp;snapshot.&nbsp;In&nbsp;the&nbsp;sample,&nbsp;you&nbsp;can&nbsp;“select”&nbsp;the&nbsp;result&nbsp;and&nbsp;highlight&nbsp;them&nbsp;on&nbsp;the&nbsp;map

 ![](https://community.thinkgeo.com/uploads/default/original/2X/4/4c35269c09ad54473dfae34243e04d7114b18312.JPG)

Ben

[151-VBDesktop.zip](https://community.thinkgeo.com/uploads/default/original/2X/8/862190f8ca1009a0d99c8504f6d90ae70b50b218.zip) (12.3 KB)
