<?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 : PassthruEsqlQuery - how to</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2009 : PassthruEsqlQuery - how to</description>
  <pubDate>Wed, 13 May 2026 16:52:56 -700</pubDate>
  <lastBuildDate>Fri, 19 Sep 2008 16:43:20 -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=942</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>PassthruEsqlQuery - how to : You probably need to use something...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=942&amp;PID=3408#3408</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 942<br /><strong>Posted:</strong> 19-Sep-2008 at 4:43pm<br /><br />You probably need to use something like "... T.DEVICE IN (SELECT <strong>VALUE</strong> Q FROM ...)".&nbsp; Here's a link to a good Entity SQL reference from Microsoft:&nbsp; <a href="http://msdn.microsoft.com/en-us/library/bb399560.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/bb399560.aspx</A><DIV></DIV>]]>
   </description>
   <pubDate>Fri, 19 Sep 2008 16:43:20 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=942&amp;PID=3408#3408</guid>
  </item> 
  <item>
   <title>PassthruEsqlQuery - how to : I expect a pass thru query to...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=942&amp;PID=3406#3406</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=377" rel="nofollow">pokaragat</a><br /><strong>Subject:</strong> 942<br /><strong>Posted:</strong> 19-Sep-2008 at 3:31pm<br /><br /><P>I expect a pass thru query to be "pass thru", which imply that what ever that database underneath the query you pass will be supported as long as it complies with the database. With the query below, it took me a while to build it to pass all the exception that would allow it to almost be executed. But at the end I got below:</P><FONT color=#a31515 size=2><P>SELECT VALUE T FROM DATA_ENTRYs AS T WHERE T.RUN_NUMBER = @RUN_NUMBER AND T.THROUGH_DATE IS NULL AND T.DEVICE_ALIAS IN ( SELECT Q.NAME FROM DEVICESs AS Q WHERE Q.NAME = \"AABB - Bill\"</P><DIV></DIV><P><FONT color=#000000>Exception:</P><DIV>The element type 'Edm.String' and the CollectionType 'Transient.collection&#091;Transient.rowtype&#091;(NAME,Edm.String(Nullable=True,DefaultValue=,MaxLength=Max,Unicode=True,FixedLength=False))&#093;(Nullable=True,DefaultValue=)&#093;' are not compatible. <FONT color=#990033>The IN expression only supports entity</FONT>, primitive, and reference types. , near IN set expression, line 1, column 117</DIV><DIV>&nbsp;</DIV><DIV>So, this is&nbsp;kinda pass thru query. I think what I need is a documentation on the limitations and what are the supported operators, etc. that DevForce EF can understand.</FONT></FONT></DIV>]]>
   </description>
   <pubDate>Fri, 19 Sep 2008 15:31:08 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=942&amp;PID=3406#3406</guid>
  </item> 
  <item>
   <title>PassthruEsqlQuery - how to : It worked. Thanks for the quick...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=942&amp;PID=3405#3405</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=377" rel="nofollow">pokaragat</a><br /><strong>Subject:</strong> 942<br /><strong>Posted:</strong> 19-Sep-2008 at 2:43pm<br /><br />It worked. Thanks for the quick response.]]>
   </description>
   <pubDate>Fri, 19 Sep 2008 14:43:14 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=942&amp;PID=3405#3405</guid>
  </item> 
  <item>
   <title>PassthruEsqlQuery - how to : Try something like:  &amp;#034;SELECT...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=942&amp;PID=3402#3402</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 942<br /><strong>Posted:</strong> 19-Sep-2008 at 2:37pm<br /><br />Try something like:<DIV>&nbsp;</DIV><DIV><FONT color=#3300ff>"SELECT VALUE&nbsp;T FROM&nbsp;<FONT size=2>DATA_SOURCE_TYPEs AS T WHERE T.DATA_SOURCE_TYPE_ID = @DATA_SOURCE_TYPE_ID"</FONT></FONT></DIV><DIV><FONT color=#000000 size=2></FONT>&nbsp;</DIV><DIV><FONT color=#000000 size=2>for the SQL string.&nbsp; It's possible that because you're using a field list the result is really an anonymous type rather than an instance of DATA_SOURCE_TYPE.</FONT></DIV>]]>
   </description>
   <pubDate>Fri, 19 Sep 2008 14:37:43 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=942&amp;PID=3402#3402</guid>
  </item> 
  <item>
   <title>PassthruEsqlQuery - how to : Here&amp;#039;s the whole code:  var...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=942&amp;PID=3401#3401</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=377" rel="nofollow">pokaragat</a><br /><strong>Subject:</strong> 942<br /><strong>Posted:</strong> 19-Sep-2008 at 2:02pm<br /><br />Here's the whole code:<DIV>&nbsp;</DIV><FONT size=2><P></FONT><FONT color=#0000ff size=2>var</FONT><FONT size=2> param = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#2b91af size=2>QueryParameter</FONT><FONT size=2>(</FONT><FONT color=#a31515 size=2>"DATA_SOURCE_TYPE_ID"</FONT><FONT size=2>, 3);</P><P></FONT><FONT color=#0000ff size=2>string</FONT><FONT size=2> fields = </FONT><FONT color=#a31515 size=2>"T.DATA_SOURCE_TYPE_ID, T.DATA_SOURE_TYPE_FROM_DATE, T.NAME, T.DESCRIPTION, T.USERNAME, T.THROUGH_DATE, T.DELETE_USERNAME"</FONT><FONT size=2>;</P><P></FONT><FONT color=#0000ff size=2>var</FONT><FONT size=2> paramEsql = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#2b91af size=2>ParameterizedEsql</FONT><FONT size=2>(</FONT><FONT color=#0000ff size=2>string</FONT><FONT size=2>.Format(</FONT><FONT color=#a31515 size=2>" SELECT {0} FROM DATA_SOURCE_TYPEs AS T WHERE T.DATA_SOURCE_TYPE_ID = @DATA_SOURCE_TYPE_ID"</FONT><FONT size=2>, fields), param);</P><P></FONT><FONT color=#0000ff size=2>var</FONT><FONT size=2> query1 = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#2b91af size=2>PassthruEsqlQuery</FONT><FONT size=2>(</FONT><FONT color=#0000ff size=2>typeof</FONT><FONT size=2>(</FONT><FONT color=#2b91af size=2>DATA_SOURCE_TYPE</FONT><FONT size=2>), paramEsql);</P><P></FONT><FONT color=#0000ff size=2>var</FONT><FONT size=2> res = manager.ExecuteQuery(query1);</P><DIV></DIV><P>----------</P><DIV>The sql "<FONT color=#a31515>SELECT {0} FROM DATA_SOURCE_TYPEs AS T WHERE T.DATA_SOURCE_TYPE_ID = @DATA_SOURCE_TYPE_ID", </FONT><FONT color=#000000>has DATA_SOURCE_TYPEs as the collection definition of DATA_SOURCE_TYPE entity. All the fields defined in 'fields' string are valid fields of DATA_SOURCE_TYPE.</FONT></FONT></DIV>]]>
   </description>
   <pubDate>Fri, 19 Sep 2008 14:02:38 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=942&amp;PID=3401#3401</guid>
  </item> 
  <item>
   <title>PassthruEsqlQuery - how to : First, sorry about the documentation...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=942&amp;PID=3399#3399</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 942<br /><strong>Posted:</strong> 19-Sep-2008 at 12:37pm<br /><br />First, sorry about the documentation error with the ExecuteQuery&lt;T&gt; call.&nbsp; This gives you a compiler error because a PassthruEsqlQuery is not an IEntityQuery&lt;T&gt;, which is what the method expects as its argument.&nbsp; <DIV>&nbsp;</DIV><DIV>As for the runtime exception, what does your paramEsql look like?&nbsp; It needs to return objects of DATA_SOURCE_TYPE.</DIV>]]>
   </description>
   <pubDate>Fri, 19 Sep 2008 12:37:40 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=942&amp;PID=3399#3399</guid>
  </item> 
  <item>
   <title>PassthruEsqlQuery - how to :   Per documentation, this ishow...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=942&amp;PID=3395#3395</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=377" rel="nofollow">pokaragat</a><br /><strong>Subject:</strong> 942<br /><strong>Posted:</strong> 19-Sep-2008 at 9:27am<br /><br /><DIV></DIV><FONT size=2><P></FONT><FONT color=#0000ff size=2></P><DIV>Per documentation, this is&nbsp;how we should code pass thru query:</DIV><DIV>&nbsp;</DIV><DIV>var</FONT><FONT size=2> query1 = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#2b91af size=2>PassthruEsqlQuery</FONT><FONT size=2>(</FONT><FONT color=#0000ff size=2>typeof</FONT><FONT size=2>(</FONT><FONT color=#2b91af size=2>DATA_SOURCE_TYPE</FONT><FONT size=2>), paramEsql);</DIV><DIV></FONT><FONT color=#0000ff size=2>var</FONT><FONT size=2> res = manager.ExecuteQuery&lt;</FONT><FONT color=#2b91af size=2>DATA_SOURCE_TYPE</FONT><FONT size=2>&gt;( query1 );</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>However, that has compiler error or even intellisense does not let you do that.</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>I modified the code as below to compile however it threw an exception:</FONT></DIV><DIV><FONT size=2><FONT color=#0000ff size=2></FONT></FONT>&nbsp;</DIV><DIV><FONT size=2><FONT color=#0000ff size=2>var</FONT><FONT size=2> query1 = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#2b91af size=2>PassthruEsqlQuery</FONT><FONT size=2>(</FONT><FONT color=#0000ff size=2>typeof</FONT><FONT size=2>(</FONT><FONT color=#2b91af size=2>DATA_SOURCE_TYPE</FONT><FONT size=2>), paramEsql);</FONT></FONT></DIV><DIV><FONT size=2><FONT color=#0000ff size=2>var</FONT><FONT size=2> res = manager.ExecuteQuery( query1 );</DIV></FONT></FONT><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>The specified cast from a materialized 'System.Data.Objects.MaterializedDataRecord' type to the 'VCLData.DATA_SOURCE_TYPE' type is not valid."</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>Pleas help.</DIV></FONT>]]>
   </description>
   <pubDate>Fri, 19 Sep 2008 09:27:16 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=942&amp;PID=3395#3395</guid>
  </item> 
 </channel>
</rss>