<?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 Arc Objects - Evaluate entire query from string variable in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/arc-objects-evaluate-entire-query-from-string/m-p/118921#M3095</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have been working with ArcObjects using IQueryDef to create queries. Using IQueryDef incroporates the use of 'Subfields', 'Tables' and a 'WhereClause' to create the query definition. This works pretty well. However, I want to be able to work with arc objects and spatial data that runs a query without having to break it into Subfields, Tables, and a WhereClause.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a form that allows a user to enter in an entire query ( in the form SELECT * FROM myTable WHere ID = 7). I am able to grab this 'string' and store it in a variable. I want to be able to evaulate this string variable (or query) in arc objects. I had envisioned something along the lines of&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;

ICursor _cursor = null;

string&amp;nbsp; _query = "SELECT * FROM myTable WHERE Id = 7";
IQueryDef _pdq = _pfeatureWorkspace.CreateQueryDef();
_cursor = _pdq.Evaluate(_query);

&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, I;ve tried some variations of this and it is not successful. I get an error along the lines of "No overload for method".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've been looking into using SQLCommand to capture the entire qurey as a single string and place it in a variable. More testing is needed there.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any information on this topic would be greatly appreciated. Thanks in advance.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 May 2014 17:20:26 GMT</pubDate>
    <dc:creator>JamariPowers</dc:creator>
    <dc:date>2014-05-01T17:20:26Z</dc:date>
    <item>
      <title>Arc Objects - Evaluate entire query from string variable</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/arc-objects-evaluate-entire-query-from-string/m-p/118921#M3095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have been working with ArcObjects using IQueryDef to create queries. Using IQueryDef incroporates the use of 'Subfields', 'Tables' and a 'WhereClause' to create the query definition. This works pretty well. However, I want to be able to work with arc objects and spatial data that runs a query without having to break it into Subfields, Tables, and a WhereClause.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a form that allows a user to enter in an entire query ( in the form SELECT * FROM myTable WHere ID = 7). I am able to grab this 'string' and store it in a variable. I want to be able to evaulate this string variable (or query) in arc objects. I had envisioned something along the lines of&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;

ICursor _cursor = null;

string&amp;nbsp; _query = "SELECT * FROM myTable WHERE Id = 7";
IQueryDef _pdq = _pfeatureWorkspace.CreateQueryDef();
_cursor = _pdq.Evaluate(_query);

&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, I;ve tried some variations of this and it is not successful. I get an error along the lines of "No overload for method".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've been looking into using SQLCommand to capture the entire qurey as a single string and place it in a variable. More testing is needed there.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any information on this topic would be greatly appreciated. Thanks in advance.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 May 2014 17:20:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/arc-objects-evaluate-entire-query-from-string/m-p/118921#M3095</guid>
      <dc:creator>JamariPowers</dc:creator>
      <dc:date>2014-05-01T17:20:26Z</dc:date>
    </item>
  </channel>
</rss>

