<?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 : Cannot execute query against cache</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Cannot execute query against cache</description>
  <pubDate>Tue, 21 Apr 2026 05:50:22 -700</pubDate>
  <lastBuildDate>Fri, 30 Apr 2010 04:31:58 -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=1763</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>Cannot execute query against cache : Thanks Greg! I&amp;#039;ll try that...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1763&amp;PID=6740#6740</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=188" rel="nofollow">JeeZ</a><br /><strong>Subject:</strong> 1763<br /><strong>Posted:</strong> 30-Apr-2010 at 4:31am<br /><br />Thanks Greg! I'll try that and get back to you next week if it doesn't work (but I'm confident it will).<br /><br />Have a nice week-end!]]>
   </description>
   <pubDate>Fri, 30 Apr 2010 04:31:58 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1763&amp;PID=6740#6740</guid>
  </item> 
  <item>
   <title>Cannot execute query against cache :   Originally posted by JeeZ query...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1763&amp;PID=6737#6737</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=4" rel="nofollow">GregD</a><br /><strong>Subject:</strong> 1763<br /><strong>Posted:</strong> 29-Apr-2010 at 6:54pm<br /><br /><table width="99%"><tr><td class="BBquote"><strong><em>Originally posted by JeeZ</strong></em><br /><br /><br><table width="99%"><tr><td><pre class="BBcode">query = _manager.Customers.Where(p =&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p.CompanyName.Contains(_searchKeyword)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; || <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p.ContactName.Contains(_searchKeyword)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ||<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p.ContactTitle.Contains(_searchKeyword)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ||<br>&nbsp;&nbsp;&nbsp;&n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nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ||<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p.Fax.Contains(_searchKeyword)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; );<br></pre></td></tr></table><br></td></tr></table><br><br>Nice that you were using the NorthwindIB database: that made debugging this a bunch easier, since I have not only the same schema but virtually the same data to test with.<br><br>Your query fails because the columns Region and Fax have nulls in them, and .Contains() isn't defined on a null in LINQ. (The query against the server succeeds because EF translates it to SQL that works.)<br><br>If your copy of NorthwindIB is like mine, you'll also find two records that have nulls in some of the other columns besides Region and Fax; but those two records have nulls in <i>all </i>of the columns on which you're doing the test, so they don't meet the condition you've posed and are never brought down to the client. Therefore they don't cause the query to fail when it's run on the client!<br><br>THE FIX<br><br>You can make your query work by changing the syntax of your tests to the following:<br><br><table width="99%"><tr><td><pre class="BBcode"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (p.Region ?? "").Contains(_searchKeyword)<br></pre></td></tr></table><br><br>That converts any null to an empty string before executing the Contains test.<br><br>As it so happens, we had already changed DevForce (I now know) to do the above translation automatically; so as of the next release, the syntax you used to begin with will work. But you'll need the above syntax for now.<br><br>]]>
   </description>
   <pubDate>Thu, 29 Apr 2010 18:54:54 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1763&amp;PID=6737#6737</guid>
  </item> 
  <item>
   <title>Cannot execute query against cache : That should work. We&amp;#039;re going...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1763&amp;PID=6729#6729</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=477" rel="nofollow">ting</a><br /><strong>Subject:</strong> 1763<br /><strong>Posted:</strong> 29-Apr-2010 at 5:26pm<br /><br />That should work.&nbsp; We're going to run some tests and will let you know what we find.<DIV></DIV>]]>
   </description>
   <pubDate>Thu, 29 Apr 2010 17:26:14 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1763&amp;PID=6729#6729</guid>
  </item> 
  <item>
   <title>Cannot execute query against cache : Hi everybody,Here&amp;#039;s the query...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1763&amp;PID=6683#6683</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=188" rel="nofollow">JeeZ</a><br /><strong>Subject:</strong> 1763<br /><strong>Posted:</strong> 27-Apr-2010 at 6:44pm<br /><br />Hi everybody,<br><br>Here's the query I'm trying to execute :<br><br><table width="99%"><tr><td><pre class="BBcode">query = _manager.Customers.Where(p =&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p.CompanyName.Contains(_searchKeyword)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; || <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p.Cont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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p.Region.Contains(_searchKeyword)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ||<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p.Phone.Contains(_searchKeyword)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ||<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p.Fax.Contains(_searchKeyword)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; );</pre></td></tr></table><br>Here's the exception :<br><table width="99%"><tr><td><pre class="BBcode">Execution of query against the server was successful but execution of query against the local cache failed</pre></td></tr></table><br><br>Why? <br><br>Note: In a C# WinForm Application, on NorthwindIB database, DevForce Universal Express.<br>]]>
   </description>
   <pubDate>Tue, 27 Apr 2010 18:44:04 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1763&amp;PID=6683#6683</guid>
  </item> 
 </channel>
</rss>