<?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: Cannot pass the DateTime value to ArcGIS query in silverlight! in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/cannot-pass-the-datetime-value-to-arcgis-query-in/m-p/677983#M17436</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Super thanks. It works very well. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The server doesn't know your 'dtStartDate' variable so you have to replace it by its value:&lt;BR /&gt; &lt;BR /&gt;string querySearch = "TIME_FINISH &amp;gt;= TO_DATE('" +&lt;BR /&gt;dtStartDate.ToString(&lt;SPAN style="color:black;"&gt;&lt;SPAN style="font-size: 2; font-family: Consolas;"&gt;"MM/dd/yyyy hh:mm:ss tt"&lt;/SPAN&gt;)&lt;/SPAN&gt; +&lt;BR /&gt;"', 'MM/DD/YYYY HH:MI:SS AM')";&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Dec 2011 12:59:54 GMT</pubDate>
    <dc:creator>AnhTruong</dc:creator>
    <dc:date>2011-12-06T12:59:54Z</dc:date>
    <item>
      <title>Cannot pass the DateTime value to ArcGIS query in silverlight!</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/cannot-pass-the-datetime-value-to-arcgis-query-in/m-p/677981#M17434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Please advice me whether or not I can pass the DateTime value to QueryTask in ESRI.ArcGIS query???&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My Silverlight page have a DatePicker, Textbox and Search button. When I select a date to binding the value to textbox. I would like to pass datetime value to ArcGIS query as following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;========================================================================&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;string paramStartDate;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;paramStartDate = txtStartName.Text;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DateTime dtStartDate = Convert.ToDateTime(paramStartDate);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;// if I selected the date from DatePicker is 7/30/2010, I can trace the selected value using VS 2010 //debugging with System.DateTime datatype {7/30/2011 12:00:00 AM}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;QueryTask queryTask = new QueryTask(URLService);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;queryTask.ExecuteCompleted += QueryTask_ExecuteCompleted;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;queryTask.Failed += QueryTask_Failed;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ESRI.ArcGIS.Client.Tasks.Query query = new ESRI.ArcGIS.Client.Tasks.Query();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;query.OutFields.Add("*");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//This query cannot return the records even though they existed in database&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;string querySearch = "TIME_FINISH &amp;gt;= TO_DATE(dtStartDate, 'MM/DD/YYYY HH:MI:SS AM')";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// but this query is working if I do hard code&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//string querySearch = "TIME_FINISH &amp;gt;= TO_DATE('7/30/2011 12:00:00 PM', 'MM/DD/YYYY HH:MI:SS AM')";&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;query.Where = querySearch; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;queryTask.ExecuteAsync(query);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;======================================================================&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I debugged the Silverlight and using Add Watch for looking the value dtStartDate, for example if I selected 10/8/2011 from calendar of DatePicker and can see the value of dtStartDate is {8/12/2011 12:00:00 AM} with System.DateTime datatype. Then step into the querySearch string, but I can not see the actual value of dtStartDate. That why my QueryTask execute without any returned records. Is it any way to do it in ArcGIS API for Silverlight??? Your prompt helps are much appreciated. Thanks in advance.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2011 16:56:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/cannot-pass-the-datetime-value-to-arcgis-query-in/m-p/677981#M17434</guid>
      <dc:creator>AnhTruong</dc:creator>
      <dc:date>2011-12-01T16:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot pass the DateTime value to ArcGIS query in silverlight!</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/cannot-pass-the-datetime-value-to-arcgis-query-in/m-p/677982#M17435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;//This query cannot return the records even though they existed in database&lt;BR /&gt;string querySearch = "TIME_FINISH &amp;gt;= TO_DATE(dtStartDate, 'MM/DD/YYYY HH:MI:SS AM')";&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;The server doesn't know your 'dtStartDate' variable so you have to replace it by its value:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;string querySearch = "TIME_FINISH &amp;gt;= TO_DATE('" +&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;dtStartDate.ToString(&lt;/SPAN&gt;&lt;SPAN style="color:black;"&gt;&lt;SPAN style="font-size: 2; font-family: Consolas;"&gt;"MM/dd/yyyy hh:mm:ss tt"&lt;/SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt; +&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"', 'MM/DD/YYYY HH:MI:SS AM')";&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Dec 2011 06:45:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/cannot-pass-the-datetime-value-to-arcgis-query-in/m-p/677982#M17435</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2011-12-02T06:45:26Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot pass the DateTime value to ArcGIS query in silverlight!</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/cannot-pass-the-datetime-value-to-arcgis-query-in/m-p/677983#M17436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Super thanks. It works very well. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The server doesn't know your 'dtStartDate' variable so you have to replace it by its value:&lt;BR /&gt; &lt;BR /&gt;string querySearch = "TIME_FINISH &amp;gt;= TO_DATE('" +&lt;BR /&gt;dtStartDate.ToString(&lt;SPAN style="color:black;"&gt;&lt;SPAN style="font-size: 2; font-family: Consolas;"&gt;"MM/dd/yyyy hh:mm:ss tt"&lt;/SPAN&gt;)&lt;/SPAN&gt; +&lt;BR /&gt;"', 'MM/DD/YYYY HH:MI:SS AM')";&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2011 12:59:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/cannot-pass-the-datetime-value-to-arcgis-query-in/m-p/677983#M17436</guid>
      <dc:creator>AnhTruong</dc:creator>
      <dc:date>2011-12-06T12:59:54Z</dc:date>
    </item>
  </channel>
</rss>

