<?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: Searchin multiple fields using QueryTask in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/searchin-multiple-fields-using-querytask/m-p/24282#M589</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I posted a related topic that may be of help here &lt;A href="http://davetimmins.wordpress.com/2011/09/09/fluent-where-clause/"&gt;http://davetimmins.wordpress.com/2011/09/09/fluent-where-clause/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Great link, thank you very much.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Jan 2012 12:50:50 GMT</pubDate>
    <dc:creator>gabrielvazquez</dc:creator>
    <dc:date>2012-01-12T12:50:50Z</dc:date>
    <item>
      <title>Searchin multiple fields using QueryTask</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/searchin-multiple-fields-using-querytask/m-p/24275#M582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Using query task to search a rest service and populate various comboboxes and sorting the results using LINQ. Users can then use the comboboxes and another query task to recieve graphic results from the rest service. This works fine when I query individual fields, however I want to be able to let the user search by multiple comboboxes and I thought I could use a querytask and the query.where option to do so. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example, something like where GISStateName = 'Maryland' AND GISIncidentType = 'BombThreat'. But in this case it might look something like &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;query.Text = StateNameCombobox.SelectedItem.ToString() AND IncidentNameComboBox.SelectedItem.ToString();&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, I'm not sure if this is even possible or what the correct syntax would be. I have tried a few different ways, but I cant seem to get anything to work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can do this with one field, e.g, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;query.Text = StateNameComboBox.SelectedItem.ToString();&amp;nbsp;&amp;nbsp; But not with mutiple field parameters. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way to use querytask to search multiple fields within a rest service? If so does anyone have any examples. I've looked at the concept and API examples below, but the information I am looking for.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/help/index.html#/Query_task/01660000001t000000/"&gt;http://help.arcgis.com/en/webapi/silverlight/help/index.html#/Query_task/01660000001t000000/&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#AttributeQuery"&gt;http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#AttributeQuery&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jan 2012 12:35:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/searchin-multiple-fields-using-querytask/m-p/24275#M582</guid>
      <dc:creator>gabrielvazquez</dc:creator>
      <dc:date>2012-01-11T12:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: Searchin multiple fields using QueryTask</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/searchin-multiple-fields-using-querytask/m-p/24276#M583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Gabriel, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can perform a query using multiple fields, but you will have to use the "Where" property of the "Query" object instead of "Text". &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Tasks.Query_members.html"&gt;http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Tasks.Query_members.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Search the API Reference for more info:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/apiref/api_start.htm"&gt;http://help.arcgis.com/en/webapi/silverlight/apiref/api_start.htm&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jan 2012 13:55:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/searchin-multiple-fields-using-querytask/m-p/24276#M583</guid>
      <dc:creator>DarinaTchountcheva</dc:creator>
      <dc:date>2012-01-11T13:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: Searchin multiple fields using QueryTask</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/searchin-multiple-fields-using-querytask/m-p/24277#M584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;&lt;BLOCKQUOTE&gt;darinatch;162367 wrote:&lt;BR /&gt;Gabriel, &lt;/BLOCKQUOTE&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can perform a query using multiple fields, but you will have to use the "Where" property of the "Query" object instead of "Text". &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, sorry I should have said I have been trying to use query.Where also, however I am still having issues formatting the query. The code states it will accept SQL statements&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Where A where clause for the query. Any legal SQL where clause operating on the fields in the layer is allowed, for example: where=POP2000 &amp;gt; 350000 .&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;However, there is any more detail and when I try code a simple query.where it does not work. I've tried it various ways, but it continues to not work. Wasnt sure if someone else has had success in using this example.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jan 2012 14:49:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/searchin-multiple-fields-using-querytask/m-p/24277#M584</guid>
      <dc:creator>gabrielvazquez</dc:creator>
      <dc:date>2012-01-11T14:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: Searchin multiple fields using QueryTask</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/searchin-multiple-fields-using-querytask/m-p/24278#M585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I was able to find the thread below, which helps in better understanding the Query.Where syntax.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/28868-Query-Syntax"&gt;http://forums.arcgis.com/threads/28868-Query-Syntax&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jan 2012 15:29:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/searchin-multiple-fields-using-querytask/m-p/24278#M585</guid>
      <dc:creator>gabrielvazquez</dc:creator>
      <dc:date>2012-01-11T15:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: Searchin multiple fields using QueryTask</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/searchin-multiple-fields-using-querytask/m-p/24279#M586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;K. I figured it out somewhat. But I wish ESRI would post more information on how to format the "Where" property of the "Query" object. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was able to do the following, but still trying to figure out how to look at multiple fields.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;query.Where = "StateName = '" + StateComboBox.SelectedItem + "'";&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;or for specific text &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;query.Where = "StateName = '" + "Maryland" + "'";&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This should work for multiple fields, forgot you need &amp;amp;&amp;amp;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;query.Where = "StateName = '" + StateComboBox.SelectedItem+ " ' "&amp;nbsp; &amp;amp;&amp;amp;&amp;nbsp; "IncidentType = '" + IncidentTypeComboBox +" ' ";&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just have to fool around with it some more. Actuall the use of the above &amp;amp;&amp;amp; operator or &amp;amp;, or AND do not work when searching for strings for multiple fields.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jan 2012 16:06:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/searchin-multiple-fields-using-querytask/m-p/24279#M586</guid>
      <dc:creator>gabrielvazquez</dc:creator>
      <dc:date>2012-01-11T16:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Searchin multiple fields using QueryTask</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/searchin-multiple-fields-using-querytask/m-p/24280#M587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Figured it out, was confusing linq and sql. Replaced the &amp;amp;&amp;amp; with AND and removed the extra " mark I had before the &amp;amp;&amp;amp; operator.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Incorred&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;query.Where = "StateName = '" + StateComboBox.SelectedItem+ " ' "&amp;nbsp; &amp;amp;&amp;amp;&amp;nbsp; "IncidentType = '" + IncidentTypeComboBox +" ' ";&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Correct&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;query.Where = "StateName = '" + StateComboBox.SelectedItem+ " '&amp;nbsp; AND "IncidentType = '" + IncidentTypeComboBox +" ' ";&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jan 2012 16:32:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/searchin-multiple-fields-using-querytask/m-p/24280#M587</guid>
      <dc:creator>gabrielvazquez</dc:creator>
      <dc:date>2012-01-11T16:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: Searchin multiple fields using QueryTask</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/searchin-multiple-fields-using-querytask/m-p/24281#M588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I posted a related topic that may be of help here &lt;/SPAN&gt;&lt;A href="http://davetimmins.wordpress.com/2011/09/09/fluent-where-clause/"&gt;http://davetimmins.wordpress.com/2011/09/09/fluent-where-clause/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jan 2012 20:23:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/searchin-multiple-fields-using-querytask/m-p/24281#M588</guid>
      <dc:creator>DaveTimmins</dc:creator>
      <dc:date>2012-01-11T20:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: Searchin multiple fields using QueryTask</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/searchin-multiple-fields-using-querytask/m-p/24282#M589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I posted a related topic that may be of help here &lt;A href="http://davetimmins.wordpress.com/2011/09/09/fluent-where-clause/"&gt;http://davetimmins.wordpress.com/2011/09/09/fluent-where-clause/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Great link, thank you very much.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jan 2012 12:50:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/searchin-multiple-fields-using-querytask/m-p/24282#M589</guid>
      <dc:creator>gabrielvazquez</dc:creator>
      <dc:date>2012-01-12T12:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: Searchin multiple fields using QueryTask</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/searchin-multiple-fields-using-querytask/m-p/24283#M590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hi...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i'm having the same problem exactly like this..&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;can someone show me is the code works or not..&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;please...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Aug 2013 08:20:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/searchin-multiple-fields-using-querytask/m-p/24283#M590</guid>
      <dc:creator>ashash</dc:creator>
      <dc:date>2013-08-16T08:20:05Z</dc:date>
    </item>
  </channel>
</rss>

