<?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 : OrderBy</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce Classic : OrderBy</description>
  <pubDate>Mon, 27 Apr 2026 03:45:09 -700</pubDate>
  <lastBuildDate>Thu, 20 May 2010 06:08:21 -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=1821</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>OrderBy : Helpful ideas, thanks!  </title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1821&amp;PID=6973#6973</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=755" rel="nofollow">evanian</a><br /><strong>Subject:</strong> 1821<br /><strong>Posted:</strong> 20-May-2010 at 6:08am<br /><br />Helpful ideas, thanks!]]>
   </description>
   <pubDate>Thu, 20 May 2010 06:08:21 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1821&amp;PID=6973#6973</guid>
  </item> 
  <item>
   <title>OrderBy : You can&amp;#039;t order by a spanned...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1821&amp;PID=6962#6962</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=21" rel="nofollow">IdeaBlade</a><br /><strong>Subject:</strong> 1821<br /><strong>Posted:</strong> 19-May-2010 at 5:06pm<br /><br />You can't order by a spanned column because the EntityList returned by the query only contains the primary Entity type (AS400Client in your case).&nbsp; You're trying to sort a collection of AS400Client entities on a column that doesn't exist on the AS400Client  entity.<br><br>The effect of the span is simply to load the AS400Workplace into the cache as a byproduct of your query for AS400Clients. <br><br>If you want an entity that combines the columns of AS400Clients and AS400Workplace, you might want to create a view in your database and then base a new entity type on that.&nbsp; However, that tends to become problematic if you need to change and save the retrieved entities.<br><br>You could probably write an IComparer&lt;T&gt; that would sort AS400Clients by a column on the related AS400Workplace (assuming that's a 1-1 relationship). See the example "Reusable MultiProperty Sorter" (and specifically the file MultiPropertyComparer.cs) under the BindableList topic in the 200 Intermediate Learning Units for an example of a custom IComparer&lt;T&gt;<br><br> ]]>
   </description>
   <pubDate>Wed, 19 May 2010 17:06:57 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1821&amp;PID=6962#6962</guid>
  </item> 
  <item>
   <title>OrderBy : Is it possible to OrderBy a spanned...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1821&amp;PID=6929#6929</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=755" rel="nofollow">evanian</a><br /><strong>Subject:</strong> 1821<br /><strong>Posted:</strong> 18-May-2010 at 9:17am<br /><br />Is it possible to OrderBy a spanned column in an RdbQuery?&nbsp; What I would like to do is this:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Query<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _query = new RdbQuery(typeof(AS400Client));<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Where clause<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _query.AddClause(&nbsp;&nbsp;&nbsp; AS400Client.FirstNameEntityColumn, <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; EntityQueryOp.EQ, <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; "David");<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Add span to other table<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _query.AddSpan(EntityRelations.AS400Workplace_AS400Client);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Add orderby on column in *related* table<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EntityOrderBy orderBy = new EntityOrderBy(AS400Workplace.DescriptionEntityColumn, ListSortDirection.Descending);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _query.ClearOrderBy();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _query.AddOrderBy(orderBy);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Get the clients <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PersistenceManager pm = PersistenceManager.DefaultManager;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _clients = pm.GetEntities&lt;AS400Client&gt;(_query);&nbsp;&nbsp; <br><br><br>Of course, I get an error:&nbsp; "Cannot find column Description."&nbsp;&nbsp; Is there any way of doing this?<br><br>(The reason why I'm not simply defining the query as being of the AS400Workplace type is that I want, potentially, to order by columns in either table, dynamically, depending on user input).<br>]]>
   </description>
   <pubDate>Tue, 18 May 2010 09:17:39 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1821&amp;PID=6929#6929</guid>
  </item> 
 </channel>
</rss>