<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Query Builder in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/query-builder/m-p/125342#M3307</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just cast your layer to&amp;nbsp;&lt;A href="http://desktop.arcgis.com/en/arcobjects/latest/net/IFeatureLayerDefinition2.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;IFeatureLayerDefinition2&lt;/A&gt;&amp;nbsp;and set its&amp;nbsp;&lt;A href="http://desktop.arcgis.com/en/arcobjects/latest/net/IFeatureLayerDefinition2_DefinitionExpression.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;DefinitionExpression&lt;/A&gt;&amp;nbsp;property. This property is actually the same thing that you set via layer's properties definition query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; featureLayerDefinition &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; featureLayer &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; IFeatureLayerDefinition2&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;featureLayerDefinition &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; featureLayerDefinition&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;DefinitionExpression &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; $&lt;SPAN class="string token"&gt;"Num = '{comboBox2.Text}'"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 07:08:45 GMT</pubDate>
    <dc:creator>MaxMax2</dc:creator>
    <dc:date>2021-12-11T07:08:45Z</dc:date>
    <item>
      <title>Query Builder</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/query-builder/m-p/125341#M3306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Situation : you have a layer in TOC, then right click and properties display, then go to Definition Query then Query Builder.&lt;/P&gt;&lt;P&gt;I been trying to mimic this procedure using Arc objects with C#,&lt;/P&gt;&lt;P&gt;as an example :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;IQueryFilter pQueryfilter = new QueryFilterClass();&lt;BR /&gt; pQueryfilter.WhereClause = "Num ='" + comboBox2.Text + "'";&lt;BR /&gt; IFeatureSelection pfeatureselection = pFeatureLayer as IFeatureSelection;&lt;BR /&gt; pfeatureselection.SelectFeatures (pQueryfilter, esriSelectionResultEnum.esriSelectionResultNew, false);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the code above it doesn't do what I want : the code above select the features eventually will zoom into......, but still, &amp;nbsp; if I go to my table I can see all the records and highlighter the selected ones, I just want to see in my table those ones selected as it is under Query Builder. It is possible to do it?.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know that there is a way to create a new layer from the selected features and added to the project depending in the selection but this is not what I want either.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jan 2017 23:58:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/query-builder/m-p/125341#M3306</guid>
      <dc:creator>Jose_LuisGarcinuno-Oporto</dc:creator>
      <dc:date>2017-01-24T23:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: Query Builder</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/query-builder/m-p/125342#M3307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just cast your layer to&amp;nbsp;&lt;A href="http://desktop.arcgis.com/en/arcobjects/latest/net/IFeatureLayerDefinition2.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;IFeatureLayerDefinition2&lt;/A&gt;&amp;nbsp;and set its&amp;nbsp;&lt;A href="http://desktop.arcgis.com/en/arcobjects/latest/net/IFeatureLayerDefinition2_DefinitionExpression.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;DefinitionExpression&lt;/A&gt;&amp;nbsp;property. This property is actually the same thing that you set via layer's properties definition query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; featureLayerDefinition &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; featureLayer &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; IFeatureLayerDefinition2&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;featureLayerDefinition &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; featureLayerDefinition&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;DefinitionExpression &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; $&lt;SPAN class="string token"&gt;"Num = '{comboBox2.Text}'"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:08:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/query-builder/m-p/125342#M3307</guid>
      <dc:creator>MaxMax2</dc:creator>
      <dc:date>2021-12-11T07:08:45Z</dc:date>
    </item>
    <item>
      <title>Re: Query Builder</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/query-builder/m-p/125343#M3308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot, it did work perfectly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jan 2017 16:52:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/query-builder/m-p/125343#M3308</guid>
      <dc:creator>Jose_LuisGarcinuno-Oporto</dc:creator>
      <dc:date>2017-01-25T16:52:08Z</dc:date>
    </item>
  </channel>
</rss>

