<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Simple Query</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Simple Query</description>
  <pubDate>Wed, 29 Jul 2026 17:01:24 -700</pubDate>
  <lastBuildDate>Fri, 18 Mar 2011 09:35:36 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=2561</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Simple Query : Maybe I didn&amp;#039;t explain clearly...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2561&amp;PID=10204#10204</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 2561<br /><strong>Posted:</strong> 18-Mar-2011 at 9:35am<br /><br />Maybe I didn't explain clearly initially.<DIV>&nbsp;</DIV><DIV>In silverlight apps you can only access the datasource asynchronously.</DIV><DIV>&nbsp;</DIV><DIV>If you try to execute a query synchronously, it might thrown an error, or (if you have set so) it will run against the cache only.</DIV><DIV>&nbsp;</DIV><DIV>var query1 = mgr.Employees;</DIV><DIV>query1.ExecuteAsync(); // Ok in silverlight</DIV><DIV>query1.Execute(); // not ok in SL</DIV><DIV>&nbsp;</DIV><DIV>var query2 = query1.With(QueryStrategy.CacheOnly);</DIV><DIV>query2.Execute(); // Ok in Silverlight - CacheOnly query</DIV>]]>
   </description>
   <pubDate>Fri, 18 Mar 2011 09:35:36 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2561&amp;PID=10204#10204</guid>
  </item> 
  <item>
   <title>Simple Query : this time it worked without any...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2561&amp;PID=10201#10201</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=243" rel="nofollow">cuneytgargin</a><br /><strong>Subject:</strong> 2561<br /><strong>Posted:</strong> 18-Mar-2011 at 2:51am<br /><br />this time it worked without any error message showing ...<br>i did not understand why..<br>]]>
   </description>
   <pubDate>Fri, 18 Mar 2011 02:51:23 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2561&amp;PID=10201#10201</guid>
  </item> 
  <item>
   <title>Simple Query : Just to be sure, you are executing...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2561&amp;PID=10196#10196</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 2561<br /><strong>Posted:</strong> 17-Mar-2011 at 8:37am<br /><br /><DIV>Just to be sure, you are executing the query asynchronously, right? ( I put an sync snippet there, but in this case - SL app - you should be executing the query async first, unless you already have the entities in cache) </DIV><DIV>&nbsp;</DIV><DIV>Also, have you tried checking for errors? </DIV><DIV>i.e.</DIV><DIV>var query2 = mgr.WebUsers.Where(c =&gt; c.username == "cg");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <DIV>query.ExecuteAsync(op =&gt;&nbsp;{</DIV><DIV>&nbsp; if (op.HasError) {</DIV><DIV>&nbsp;&nbsp;&nbsp; MessageBox.Show(op.Error.Message)</DIV><DIV>&nbsp; } else {</DIV><DIV>&nbsp; &nbsp;&nbsp;foreach (WebUser auser in op.Results) {<BR>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;if (auser.password == "cg") {<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;MessageBox.Show("OK");<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;}&nbsp;else&nbsp;{</DIV><DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;MessageBox.Show("NOTOK");</DIV><DIV>&nbsp;&nbsp;&nbsp; &nbsp; }</DIV><DIV>&nbsp;&nbsp;&nbsp; }</DIV><DIV>&nbsp; }</DIV><DIV>});</DIV></DIV><span style="font-size:10px"><br /><br />Edited by sbelini - 17-Mar-2011 at 9:04am</span>]]>
   </description>
   <pubDate>Thu, 17 Mar 2011 08:37:07 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2561&amp;PID=10196#10196</guid>
  </item> 
  <item>
   <title>Simple Query : i tried your solution,query seems...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2561&amp;PID=10195#10195</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=243" rel="nofollow">cuneytgargin</a><br /><strong>Subject:</strong> 2561<br /><strong>Posted:</strong> 17-Mar-2011 at 6:08am<br /><br />i tried your solution,<br>query seems to run.. but results don't bring any values.. but i know there is a username with "cg"<br>even i tried <br>var query2 = mgr.WebUsers;<br><br>it does not gather any data..<br>strange...<br><br><br>btw my sqlserver is on an instance<br>does it make any difference ?<br><br>any more comments ?<br><br>]]>
   </description>
   <pubDate>Thu, 17 Mar 2011 06:08:49 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2561&amp;PID=10195#10195</guid>
  </item> 
  <item>
   <title>Simple Query : Hi cuneytgargin,  query2 is...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2561&amp;PID=10181#10181</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 2561<br /><strong>Posted:</strong> 16-Mar-2011 at 3:26am<br /><br /><DIV>Hi cuneytgargin,</DIV><DIV>&nbsp;</DIV><DIV>query2 is an IEntityQuery&lt;WebUsers&gt; and not a collection with the expected results.</DIV><DIV>&nbsp;</DIV><DIV>You need to execute the query and iterate thru its results.</DIV><DIV>&nbsp;</DIV><DIV>i.e.</DIV>var query2 = mgr.WebUsers.Where(c =&gt; c.username == "cg");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <DIV>query.ExecuteAsync(op =&gt;&nbsp;{</DIV><DIV>&nbsp;&nbsp;foreach (WebUser auser in op.Results) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;if (auser.password == "cg") {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MessageBox.Show("OK");<BR>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;{</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;MessageBox.Show("NOTOK");</DIV><DIV>&nbsp;&nbsp;&nbsp; }</DIV><DIV>&nbsp; }</DIV><DIV>});</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>or, if running synchronously:</DIV><DIV>&nbsp;</DIV><DIV>var query2 = mgr.WebUsers.Where(c =&gt; c.username == "cg");<BR>var results = query2.Execute();</DIV><DIV><DIV>foreach (WebUser auser in results) {<BR>&nbsp;&nbsp;if (auser.password == "cg") {<BR>&nbsp;&nbsp;&nbsp;&nbsp;MessageBox.Show("OK");<BR>&nbsp;&nbsp;}&nbsp;else&nbsp;{</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;MessageBox.Show("NOTOK");</DIV><DIV>&nbsp; }</DIV><DIV>}</DIV></DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Wed, 16 Mar 2011 03:26:19 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2561&amp;PID=10181#10181</guid>
  </item> 
  <item>
   <title>Simple Query : Hi... I am checking ideablade...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2561&amp;PID=10179#10179</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=243" rel="nofollow">cuneytgargin</a><br /><strong>Subject:</strong> 2561<br /><strong>Posted:</strong> 16-Mar-2011 at 1:33am<br /><br />Hi... <br>I am checking ideablade 6.8<br>i have a SL project with ideablade sl template.<br><br>in my source<br>mWebUsers = new ObservableCollection&lt;WebUser&gt;();<br>var mgr = new Ax5Ent();<br>var query = mgr.WebUsers;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>query.ExecuteAsync(op =&gt; op.Results.ForEach(mWebUsers.Add));<br><br><br>runs well ....<br>but <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var query2 = mgr.WebUsers.Where(c =&gt; c.username == "cg");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach (WebUser auser in query2)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (auser.password == "cg")<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MessageBox.Show("OK");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MessageBox.Show("NOTOK");&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br><br>when i use upper code clock <br>query2 returns no result ...<br>why ?<br><br>]]>
   </description>
   <pubDate>Wed, 16 Mar 2011 01:33:47 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2561&amp;PID=10179#10179</guid>
  </item> 
 </channel>
</rss>