<?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 : EntitySql &amp; Projection</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : EntitySql &amp; Projection</description>
  <pubDate>Thu, 27 Aug 2026 01:35:50 -700</pubDate>
  <lastBuildDate>Tue, 05 Jul 2011 12:54:05 -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=2743</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>EntitySql &amp; Projection :  Hi Sven;Thanks for the more...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2743&amp;PID=11179#11179</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 2743<br /><strong>Posted:</strong> 05-Jul-2011 at 12:54pm<br /><br />Hi Sven;<div><br></div><div>Thanks for the more detailed explanation. Based on this info, I have some options that I can think of.</div><div><br></div><div>1. Functions can't be imported and used in LINQ but Stored Procedures can. So one suggestion is to rewrite your SQL Scalar Functions to SQL Stored Procs.</div><div><br></div><div>2. If you have to stick with Functions, consider re-writing your query such that it doesn't use projections. In other words, separate the query into 2 queries.&nbsp;</div><div><br></div><div>eg:&nbsp;</div><div><span ="apple-style-span"="" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><br></span></div><div><span ="apple-style-span"="" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; ">select value mye from&nbsp;MyEntity as mye where &#091;the complex stuff across my database&#093;</span></div><div><span ="apple-style-span"="" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><br></span></div><div><span ="apple-style-span"="" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; ">once you have your mye, then you can do this next call.</span></div><div><span ="apple-style-span"="" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><br></span></div><div><span ="apple-style-span"="" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; ">select dbo.MyFunction(mye.SomeField) as Rating from ...</span></div><div><span ="apple-style-span"="" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><br></span></div><div><span ="apple-style-span"="" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; ">3. Consider using Views or DefiningQuery for this complex database query.&nbsp;</span><a href="http://blogs.microsoft.co.il/blogs/gilf/archive/2008/05/14/how-why-use-definingquery-element.aspx" target="_blank">http://blogs.microsoft.co.il/blogs/gilf/archive/2008/05/14/how-why-use-definingquery-element.aspx</a></div><div><br></div><div><br></div><div>I wish I could be more helpful. We have our Professional Services if you'd like to find out more about best practices in solving this kind of problems.</div><span style="font-size:10px"><br /><br />Edited by DenisK - 05-Jul-2011 at 12:55pm</span>]]>
   </description>
   <pubDate>Tue, 05 Jul 2011 12:54:05 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2743&amp;PID=11179#11179</guid>
  </item> 
  <item>
   <title>EntitySql &amp; Projection : Hi Denis,well I tried to use LINQ...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2743&amp;PID=11157#11157</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1078" rel="nofollow">sven4tmn</a><br /><strong>Subject:</strong> 2743<br /><strong>Posted:</strong> 01-Jul-2011 at 3:53am<br /><br /><div style=": rgb255, 255, 255; margin-left: 1px; margin-top: 1px; margin-right: 1px; margin-bottom: 1px; font-family: Verdana, Arial, Helvetica, sans-serif; color: rgb0, 0, 0; font-weight: normal; font-size: 12px; line-height: 1.4; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; -: :/png;64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAOZJREFUeNrEkzEKhDAQRWfWCOIhRLDT1sLazuva23gADyDYWKuFoogIs05AcNXVLBabJpDkzX9MEiQieDJe8HSwgYpFHMdUFAX1fU9bTqiEMOx5HnRdB+M48sxFkPduCyRJQrZtS7iua1gM5Lrruvc94OQ9XJYlGIZx38St9hb2fR8cx8H1nFDVZpi1gyDAy2v8Bi+pEIYh7s9/GAzDIK8oz/OD9j75YDBNk4SFEDLtSvvUYJ5nME0T2ULTNLAsC3RdP9U+NUjTFKqqorVY0zQQRRH+8pQpyzJq25bWXqhw+Pff+BZgAD/OvI9PFUHuAAAAAElFTkSuQmCC; -: 100% 0%; -repeat: no-repeat no-repeat; ">Hi Denis,<div><br></div><div>well I tried to use LINQ but I wasn't able to execute the SQL scalar function (not a stored procedure). I didn't know how to create the function mapping on my Silverlight client. I found resources that uses&nbsp;<span ="Apple-style-span" style="font-family: c&#111;nsolas, 'Courier New', courier, monospace; font-size: 11px; line-height: 16px; white-space: pre; ">EdmFunctionAttribute</span>&nbsp;to get the functions work with LINQ, but it's not available in Silverlight... So I stuck with EntitySql:</div><div><br></div><div>My query looks like:</div><div>select value mye from&nbsp;MyEntity as mye where &#091;the complex stuff across my database&#093;</div><div><br></div><div>but I need to give a function's value along with the entity:</div><div>select value mye, dbo.MyFunction(mye.SomeField) as Rating from ...</div><div><br></div><div>I also tried (and failed) using:</div><div>select value MyEntity(&#091;..all fields..&#093;,&nbsp;dbo.MyFunction(mye.SomeField) as Rating) from ...</div><div><br></div><div>Well, if functions do not work in Silverlight + LINQ and projection does not work with EntitySql, do I have other options?</div><div><br></div></div>]]>
   </description>
   <pubDate>Fri, 01 Jul 2011 03:53:44 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2743&amp;PID=11157#11157</guid>
  </item> 
  <item>
   <title>EntitySql &amp; Projection : Hi Sven;I&amp;#039;m still trying...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2743&amp;PID=11156#11156</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 2743<br /><strong>Posted:</strong> 30-Jun-2011 at 11:52pm<br /><br />Hi Sven;<div><br></div><div>I'm still trying to understand why you need to use EntitySql. You said that the query may get very complex with where-clause and many sub-selects, as well as using SQL scalar functions, but I still don't see why this can't be done with LINQ. LINQ queries are pretty powerful as shown by these examples.&nbsp;<a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/query-101-examples" target="_blank">http://drc.ideablade.com/xwiki/bin/view/Documentation/query-101-examples</a></div><div><br></div><div>You said that you already tried to extend your entity with the "rating" property but you weren't able to fill it with the function's return value. Is this a stored proc function that you're talking about? What was the issue that you're encountering with this?</div><div><br></div><div>Perhaps, if you can show me an example of the complex query, I'll be able to help better.</div>]]>
   </description>
   <pubDate>Thu, 30 Jun 2011 23:52:59 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2743&amp;PID=11156#11156</guid>
  </item> 
  <item>
   <title>EntitySql &amp; Projection : Hi Denis,I&amp;#039;ve tried to find...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2743&amp;PID=11148#11148</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1078" rel="nofollow">sven4tmn</a><br /><strong>Subject:</strong> 2743<br /><strong>Posted:</strong> 30-Jun-2011 at 4:33am<br /><br />Hi Denis,<div><br></div><div>I've tried to find a good solution using SPs but it didn't work out for me. So maybe you can give me another advice. My problem is that I need to call a SQL (scalar) function which returns a rating (int number) along with the entity. Based on the rating I have to sort the entities in my Silverlight client. As the query may get very complex&nbsp;(where-clause with many sub-selects)&nbsp;and because I have to call SQL functions in it I switched to EntitySql.</div><div><br></div><div>Any ideas I can handle this?</div><div><br></div><div>Thanks,</div><div>Sven</div><div><br></div><div><br></div>]]>
   </description>
   <pubDate>Thu, 30 Jun 2011 04:33:28 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2743&amp;PID=11148#11148</guid>
  </item> 
  <item>
   <title>EntitySql &amp; Projection :  Hi sven4tmn;For some reason,...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2743&amp;PID=10907#10907</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 2743<br /><strong>Posted:</strong> 07-Jun-2011 at 11:49am<br /><br />Hi sven4tmn;<div><br></div><div>For some reason, I didn't see that you've said you couldn't use LINQ. My apologies.</div><div><br></div><div>Unfortunately, for the time being DevForce doesn't support projection with E-SQL. My immediate suggestions are to consider using RSMC,&nbsp;<a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/rsmc-query" target="_blank">http://drc.ideablade.com/xwiki/bin/view/Documentation/rsmc-query</a>&nbsp;or Stored Procs,&nbsp;<a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/stored-procedure-queries" target="_blank">http://drc.ideablade.com/xwiki/bin/view/Documentation/stored-procedure-queries</a>.</div><div><br></div><div>I might be able to give more specific suggestions if you can let me know your specific use case.</div><span style="font-size:10px"><br /><br />Edited by DenisK - 07-Jun-2011 at 12:16pm</span>]]>
   </description>
   <pubDate>Tue, 07 Jun 2011 11:49:47 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2743&amp;PID=10907#10907</guid>
  </item> 
  <item>
   <title>EntitySql &amp; Projection : Hi Denis,Thanks for your response....</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2743&amp;PID=10901#10901</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1078" rel="nofollow">sven4tmn</a><br /><strong>Subject:</strong> 2743<br /><strong>Posted:</strong> 06-Jun-2011 at 10:50pm<br /><br />Hi Denis,<div><br></div><div>Thanks for your response. Do you have some documentation using projection in EntitySql instead of Linq?&nbsp;</div><div><br></div><div><br></div>]]>
   </description>
   <pubDate>Mon, 06 Jun 2011 22:50:47 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2743&amp;PID=10901#10901</guid>
  </item> 
  <item>
   <title>EntitySql &amp; Projection : Hi sven4tmn;See if this page can...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2743&amp;PID=10896#10896</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 2743<br /><strong>Posted:</strong> 06-Jun-2011 at 10:51am<br /><br />Hi sven4tmn;<div><br></div><div>See if this page can help you.&nbsp;<a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/query-an&#111;nymous-projecti&#111;ns" target="_blank">http://drc.ideablade.com/xwiki/bin/view/Documentation/query-anonymous-projections</a></div>]]>
   </description>
   <pubDate>Mon, 06 Jun 2011 10:51:34 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2743&amp;PID=10896#10896</guid>
  </item> 
  <item>
   <title>EntitySql &amp; Projection : Hi,I&amp;#039;m using EntitySql in...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2743&amp;PID=10894#10894</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1078" rel="nofollow">sven4tmn</a><br /><strong>Subject:</strong> 2743<br /><strong>Posted:</strong> 06-Jun-2011 at 3:19am<br /><br />Hi,&nbsp;<div><br></div><div>I'm using EntitySql in a Silverlight client to retrieve my data. Due to complex queries and functions inside SqlServer, I wasn't able to use Linq. As long as I am retrieving whole Entites (e.g. Select Value xy from Entity as xy ...) I have no problems. But now I need to return some value calculated sqlserver-side along the entity, so I need a projection. Sorry, I can figure out how to do that. I already tried to extend my Entity with an additional property but the I wasn't able to fill it with the function's return value. Maybe you can help me a little bit.</div><div><br></div><div>Thanks in advance,</div><div>Sven</div><div><br></div>]]>
   </description>
   <pubDate>Mon, 06 Jun 2011 03:19:49 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2743&amp;PID=10894#10894</guid>
  </item> 
 </channel>
</rss>