<?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 : Using Max and Min</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Using Max and Min</description>
  <pubDate>Wed, 29 Jul 2026 15:07:51 -700</pubDate>
  <lastBuildDate>Wed, 19 Jan 2011 21:49:09 -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=2339</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>Using Max and Min : Tracing of queries within DevForce...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2339&amp;PID=9720#9720</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> 2339<br /><strong>Posted:</strong> 19-Jan-2011 at 9:49pm<br /><br />Tracing of queries within DevForce can only be done for all queries&nbsp;or limited to those for a specific&nbsp;EdmKey.&nbsp; Afraid there's no way to convert a&nbsp;DevForce EntityQuery into an EF ObjectQuery, and the&nbsp;ToTraceString method is not supported on EntityQuery.]]>
   </description>
   <pubDate>Wed, 19 Jan 2011 21:49:09 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2339&amp;PID=9720#9720</guid>
  </item> 
  <item>
   <title>Using Max and Min : How do you use ToTraceString with...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2339&amp;PID=9715#9715</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=705" rel="nofollow">chuckc</a><br /><strong>Subject:</strong> 2339<br /><strong>Posted:</strong> 19-Jan-2011 at 11:43am<br /><br />How do you use ToTraceString with a DevForce&nbsp;IEntityQuery&nbsp;query? &nbsp;The examples I find for ToTraceString all refer to ObjectQuery. &nbsp;Is there some way to convert an IEntityQuery to an ObjectQuery?<div><br></div><div>I'd prefer not to use the full DevForce trace logging - I'd just like to inspect an&nbsp;ocaissional&nbsp;query in the debugger.</div><div><br></div><div>Thanks.</div>]]>
   </description>
   <pubDate>Wed, 19 Jan 2011 11:43:59 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2339&amp;PID=9715#9715</guid>
  </item> 
  <item>
   <title>Using Max and Min : Both the EdmKey.LogTraceString...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2339&amp;PID=9384#9384</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> 2339<br /><strong>Posted:</strong> 13-Dec-2010 at 9:58am<br /><br /><P>Both the EdmKey.LogTraceString and Logging.ShouldLogSqlQueries only show queries.&nbsp; There's currently no way within DevForce to see insert/update/delete statements.&nbsp;&nbsp; The reason for this is that DevForce just uses the EF ToTraceString() method to grab the SQL query, and there's no corresponding method to easily grab the SQL generated for the insert/update/delete commands created during&nbsp;SaveChanges processing.</P><DIV>If using SQL Server there's always SQL Profiler.&nbsp;&nbsp;&nbsp;There are also 3rd party tools, such as EF Profiler.&nbsp; </DIV>]]>
   </description>
   <pubDate>Mon, 13 Dec 2010 09:58:32 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2339&amp;PID=9384#9384</guid>
  </item> 
  <item>
   <title>Using Max and Min : The previous apporach seemed only...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2339&amp;PID=9382#9382</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=508" rel="nofollow">tj62</a><br /><strong>Subject:</strong> 2339<br /><strong>Posted:</strong> 13-Dec-2010 at 9:29am<br /><br /><P>The previous apporach seemed only show select statements, but not update, insert and delete. Is it possible somehow to se those generated&nbsp;SQL&nbsp; commands?</P><DIV>Is that maybe supported in this new version 6.0.7?</DIV>]]>
   </description>
   <pubDate>Mon, 13 Dec 2010 09:29:42 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2339&amp;PID=9382#9382</guid>
  </item> 
  <item>
   <title>Using Max and Min : Version 6.0.7 added an attribute...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2339&amp;PID=9381#9381</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> 2339<br /><strong>Posted:</strong> 13-Dec-2010 at 8:53am<br /><br />Version 6.0.7 added an attribute called shouldLogSqlQueries to the &lt;logging&gt; element.&nbsp; It does exactly the same thing as the logTraceString attribute on the EdmKey; it's easier to apply since it doesn't require the EdmKey definition, and it will apply to all EF data sources.]]>
   </description>
   <pubDate>Mon, 13 Dec 2010 08:53:50 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2339&amp;PID=9381#9381</guid>
  </item> 
  <item>
   <title>Using Max and Min : When you say &amp;#034;prior to 6.0.7&amp;#034;...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2339&amp;PID=9380#9380</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=508" rel="nofollow">tj62</a><br /><strong>Subject:</strong> 2339<br /><strong>Posted:</strong> 13-Dec-2010 at 6:55am<br /><br />When you say "prior to 6.0.7" is there an more easy to use or powerfull&nbsp;alternative in version 6.0.7?]]>
   </description>
   <pubDate>Mon, 13 Dec 2010 06:55:59 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2339&amp;PID=9380#9380</guid>
  </item> 
  <item>
   <title>Using Max and Min : You can see the SQL query by adding...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2339&amp;PID=9267#9267</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> 2339<br /><strong>Posted:</strong> 27-Nov-2010 at 2:09pm<br /><br />You can see the SQL query by adding the logTraceString attribute to the EdmKey.&nbsp; You might be using a connectionString element rather than an EdmKey, but in releases prior to 6.0.7 the only way of logging the generated SQL is through this flag on the EdmKey; fortunately it's easy enough to add to your .config file.&nbsp; Here's more info: <a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/C&#111;nfigurati&#111;n" target="_blank">http://drc.ideablade.com/xwiki/bin/view/Documentation/Configuration</A>]]>
   </description>
   <pubDate>Sat, 27 Nov 2010 14:09:06 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2339&amp;PID=9267#9267</guid>
  </item> 
  <item>
   <title>Using Max and Min : Thank you kimj. Actualy where...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2339&amp;PID=9265#9265</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=508" rel="nofollow">tj62</a><br /><strong>Subject:</strong> 2339<br /><strong>Posted:</strong> 27-Nov-2010 at 1:05am<br /><br />Thank you kimj. Actualy where I was failing was formulateing the GroupBy cluse. This all compiles now, but when I run it I get an exceptoin with this error message from the Informix 11.5 Cheeta database:<DIV>&nbsp; ERROR &#091;42000&#093; &#091;IBM&#093;&#091;IDS/NT32&#093; A syntax error has occurred.<BR>Can I somewhere se the SQL-query that is generated and run against the database?<BR>Can I somehow influence the SQL-generation to avoid this syntax error?<BR><BR>Here is the LINQ query I'm running:</DIV><DIV>&nbsp;var query = p_manager.EntPointSet<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Where(p =&gt; p.p_customerID == pg.p_customerID &amp;&amp; p.p_pointGrID == pg.p_pointGrID)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Where(p =&gt; !(p.p_geoX == 0 &amp;&amp; p.p_geoY == 0))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .GroupBy(p =&gt; new { p.p_customerID, p.p_pointGrID })<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Select(g =&gt; new {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_id = g.Key,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp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var enumerator = g.GetEnumerator();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; enumerator.MoveNext();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var p = enumerator.Current;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (p != null)<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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mapBoundaries.p_leftTop = new Point(p.m_minGeoX, p.m_maxGeoY);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mapBoundaries.p_rightBottom = new Point(p.m_maxGeoX, p.m_minGeoY);<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; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; callback(mapBoundaries);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; });</DIV>]]>
   </description>
   <pubDate>Sat, 27 Nov 2010 01:05:28 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2339&amp;PID=9265#9265</guid>
  </item> 
  <item>
   <title>Using Max and Min : In LINQ, and DevForce,Max and...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2339&amp;PID=9263#9263</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> 2339<br /><strong>Posted:</strong> 26-Nov-2010 at 1:21pm<br /><br />In LINQ, and DevForce,&nbsp;Max and Min result in "immediate execution" queries, that is, a query object is not actually&nbsp;constructed but instead the&nbsp;expression is&nbsp;executed right away.&nbsp;&nbsp; This is why you see a double returned from the expression and not an EntityQuery.&nbsp; <DIV>&nbsp;</DIV><DIV>In Silverlight, where queries must be submitted asynchronously, you can use the AsScalarAsync() extension method to turn an immediate execution query into an asynchronously executed one.&nbsp; So if you wanted to issue separate min and max queries you could do something like this:</DIV><DIV><SPAN style="COLOR: blue"></SPAN>&nbsp;</DIV><DIV><SPAN style="COLOR: blue">&nbsp; var</SPAN>&nbsp;op&nbsp;=&nbsp;p_manager.EntPointSet.Where(...).Select(p&nbsp;=&gt;&nbsp;p.p_geoX).AsScalarAsync().Max();<BR></DIV><DIV>It's probably much easier to instead take advantage of grouping and anonymous projections, and do something like this instead:</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var query = p_manager.EntPointSet<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Where(p =&gt; p.p_customerId = ...)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .GroupBy(p =&gt; new { p.p_customerId, p.p_pointGrId })<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Select(g =&gt; new {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Id = g.Key,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MaxGeoX = g.Max(p =&gt; p.p_geoX),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MinGeoX = g.Min(p&nbsp;=&gt; p.p_geoX),</DIV><DIV>&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; });</DIV><DIV>This returns a query, which can&nbsp; be executed synchronously or asynchronously.</DIV>]]>
   </description>
   <pubDate>Fri, 26 Nov 2010 13:21:43 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2339&amp;PID=9263#9263</guid>
  </item> 
  <item>
   <title>Using Max and Min : Hi, I&amp;#039;m not very good at...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2339&amp;PID=9256#9256</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=508" rel="nofollow">tj62</a><br /><strong>Subject:</strong> 2339<br /><strong>Posted:</strong> 26-Nov-2010 at 7:21am<br /><br />Hi,<DIV>I'm not very good at LINQ but am very good on old fashioned SQL. I'm using DevForce with Silverlight.</DIV><DIV>&nbsp;</DIV><DIV>I have to implement the follwing SQL query in LINQ to Entities:</DIV><DIV>select max(geo_x), max(geo_y), min(geo_x), min(geo_y) from em_point where customer_id=39 and p_gr_id=1;<BR><BR>The Entity for the table em_point is EntPoint and the variablse are p_geoX, p_geoY, p_customerID, p_groupID;<BR><BR>So I try something like:</DIV><DIV>&nbsp;</DIV><DIV><FONT size=2 face=C&#111;nsolas>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var query = p_manager.EntPointSet<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Where(p =&gt; p.p_customerID == pg.p_customerID &amp;&amp; p.p_pointGrID == pg.p_pointGrID)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Where(p =&gt; !(p.p_geoX == 0 &amp;&amp; p.p_geoY == 0))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Max(p =&gt; p.p_geoX);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Query(query, callback);</FONT></DIV><P><FONT size=2 face=C&#111;nsolas>Unfortunately this is not possible as query is of type double but not IEntityQuery as expected.</P><DIV>Even if this worked I would have to do 4 such queries for Min and Max to get the same result as in the single line SQL statement. <BR>Is there any way to do the simple SQL statement in a single LINQ to Entities statement?<BR><BR>Retrieving all EntPoint first and then calculating the maxes and mins at the client side is not an option as the number of records from EntPoint is huge.<FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas></DIV><P>&nbsp;</P></FONT></FONT></FONT><DIV><BR></DIV></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas></FONT></FONT>]]>
   </description>
   <pubDate>Fri, 26 Nov 2010 07:21:57 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2339&amp;PID=9256#9256</guid>
  </item> 
 </channel>
</rss>