<?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 : Paged RdbQueries</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce Classic : Paged RdbQueries</description>
  <pubDate>Fri, 12 Jun 2026 11:24:34 -700</pubDate>
  <lastBuildDate>Wed, 06 Jun 2007 12:30:56 -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=40</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>Paged RdbQueries : Answer: Here is sample code demonstrating...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=40&amp;PID=103#103</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> 40<br /><strong>Posted:</strong> 06-Jun-2007 at 12:30pm<br /><br /><P =Questi&#111;n style="MARGIN: 0in 0in 0pt"><strong><EM><FONT face="Times New Roman" size=3>Answer:</FONT></EM></strong></P><P =Ms&#111;normal style="MARGIN: 8pt 0in 0pt"><FONT face="Times New Roman" size=2>Here is sample code demonstrating how to execute a PagedRdbQuery, which is the ideal query to use for returning large result sets. </FONT></P><P =Ms&#111;normal style="MARGIN: 8pt 0in 0pt"><FONT face="Times New Roman" size=2>This example can also be found in the IdeaBlade DevForce Help Reference (may vary slightly):</FONT></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: navy; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt"><?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p><FONT size=2>&nbsp;</FONT></o:p></SPAN></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT size=2><FONT style=": #e6e6e6"><strong><FONT face="Courier New"><FONT color=#808080>&nbsp;&nbsp;&nbsp; </FONT><SPAN style="COLOR: blue">public</SPAN><FONT color=#808080> </FONT><SPAN style="COLOR: blue">void</SPAN><FONT color=#808080> SamplePagedQuery() {</FONT></FONT></strong></FONT></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT size=2><FONT style=": #e6e6e6"><strong><FONT face="Courier New"><FONT color=#808080>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><SPAN style="COLOR: teal">PersistenceManager</SPAN><FONT color=#808080> pm = </FONT><SPAN style="COLOR: teal">PersistenceManager</SPAN><FONT color=#808080>.DefaultManager;</FONT></FONT></strong></FONT></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><o:p><FONT style=": #e6e6e6" face="Courier New" color=#808080 size=2><strong>&nbsp;</strong></FONT></o:p></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT size=2><FONT style=": #e6e6e6"><strong><FONT face="Courier New"><FONT color=#808080>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><SPAN style="COLOR: green">// Query orders in descending date sequence. <o:p></o:p></SPAN></FONT></strong></FONT></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT size=2><FONT style=": #e6e6e6"><strong><FONT face="Courier New"><FONT color=#808080>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><SPAN style="COLOR: teal">RdbQuery</SPAN><FONT color=#808080> aQuery = </FONT><SPAN style="COLOR: blue">new</SPAN><FONT color=#808080> </FONT><SPAN style="COLOR: teal">RdbQuery</SPAN><FONT color=#808080>(</FONT><SPAN style="COLOR: blue">typeof</SPAN><FONT color=#808080>(</FONT><SPAN style="COLOR: teal">Order</SPAN><FONT color=#808080>));</FONT></FONT></strong></FONT></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT size=2><FONT style=": #e6e6e6"><strong><FONT face="Courier New"><FONT color=#808080>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; aQuery.AddOrderBy(</FONT><SPAN style="COLOR: teal">Order</SPAN><FONT color=#808080>.OrderDateEntityColumn, </FONT><SPAN style="COLOR: teal">ListSortDirection</SPAN><FONT color=#808080>.Descending);</FONT></FONT></strong></FONT></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><o:p><FONT style=": #e6e6e6" face="Courier New" color=#808080 size=2><strong>&nbsp;</strong></FONT></o:p></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT size=2><FONT style=": #e6e6e6"><strong><FONT face="Courier New"><FONT color=#808080>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><SPAN style="COLOR: green">// Build a paged query to retrieve 10 items at a time. <o:p></o:p></SPAN></FONT></strong></FONT></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT size=2><FONT style=": #e6e6e6"><strong><FONT face="Courier New"><FONT color=#808080>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><SPAN style="COLOR: teal">PagedRdbQuery</SPAN><FONT color=#808080> pagedQuery = </FONT><SPAN style="COLOR: blue">new</SPAN><FONT color=#808080> </FONT><SPAN style="COLOR: teal">PagedRdbQuery</SPAN><FONT color=#808080>(aQuery);</FONT></FONT></strong></FONT></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT style=": #e6e6e6" face="Courier New" color=#808080 size=2><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pagedQuery.PageSize = 10;</strong></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><o:p><FONT style=": #e6e6e6" face="Courier New" color=#808080 size=2><strong>&nbsp;</strong></FONT></o:p></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT size=2><FONT style=": #e6e6e6"><strong><FONT face="Courier New"><FONT color=#808080>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><SPAN style="COLOR: green">// Specify whether the last item of the page will be first item on next page. <o:p></o:p></SPAN></FONT></strong></FONT></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT size=2><FONT style=": #e6e6e6"><strong><FONT face="Courier New"><FONT color=#808080>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pagedQuery.PagesShouldOverlap = </FONT><SPAN style="COLOR: blue">false</SPAN><FONT color=#808080>;</FONT></FONT></strong></FONT></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><o:p><FONT style=": #e6e6e6" face="Courier New" color=#808080 size=2><strong>&nbsp;</strong></FONT></o:p></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT size=2><FONT style=": #e6e6e6"><strong><FONT face="Courier New"><FONT color=#808080>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><SPAN style="COLOR: blue">while</SPAN><FONT color=#808080> (</FONT><SPAN style="COLOR: blue">true</SPAN><FONT color=#808080>) {</FONT></FONT></strong></FONT></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT size=2><FONT style=": #e6e6e6"><strong><FONT face="Courier New"><FONT color=#808080>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><SPAN style="COLOR: teal">EntityList</SPAN><FONT color=#808080>&lt;</FONT><SPAN style="COLOR: teal">Order</SPAN><FONT color=#808080>&gt; orders = pm.GetEntities&lt;</FONT><SPAN style="COLOR: teal">Order</SPAN><FONT color=#808080>&gt;(pagedQuery);</FONT></FONT></strong></FONT></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT size=2><FONT style=": #e6e6e6"><strong><FONT face="Courier New"><FONT color=#808080>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><SPAN style="COLOR: teal">Console</SPAN><FONT color=#808080>.WriteLine(</FONT><SPAN style="COLOR: maro&#111;n">"Current page = "</SPAN><FONT color=#808080> + pagedQuery.CurrentPage.ToString());</FONT></FONT></strong></FONT></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT size=2><FONT style=": #e6e6e6"><strong><FONT face="Courier New"><FONT color=#808080>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><SPAN style="COLOR: teal">Console</SPAN><FONT color=#808080>.WriteLine(</FONT><SPAN style="COLOR: maro&#111;n">"Order count for this page = "</SPAN><FONT color=#808080> + orders.Count.ToString());</FONT></FONT></strong></FONT></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT size=2><FONT style=": #e6e6e6"><strong><FONT face="Courier New"><FONT color=#808080>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><SPAN style="COLOR: blue">foreach</SPAN><FONT color=#808080> (</FONT><SPAN style="COLOR: teal">Order</SPAN><FONT color=#808080> anOrder </FONT><SPAN style="COLOR: blue">in</SPAN><FONT color=#808080> orders) {</FONT></FONT></strong></FONT></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT size=2><FONT style=": #e6e6e6"><strong><FONT face="Courier New"><FONT color=#808080>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><SPAN style="COLOR: teal">Console</SPAN><FONT color=#808080>.WriteLine(</FONT><SPAN style="COLOR: maro&#111;n">" Order id = "</SPAN><FONT color=#808080> + anOrder.Id.ToString() + </FONT><SPAN style="COLOR: maro&#111;n">", date = "</SPAN><FONT color=#808080> + anOrder.OrderDate);</FONT></FONT></strong></FONT></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT style=": #e6e6e6" face="Courier New" color=#808080 size=2><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</strong></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT size=2><FONT style=": #e6e6e6"><strong><FONT face="Courier New"><FONT color=#808080>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><SPAN style="COLOR: blue">if</SPAN><FONT color=#808080> (pagedQuery.IsLastPage) </FONT><SPAN style="COLOR: blue">break</SPAN><FONT color=#808080>;</FONT></FONT></strong></FONT></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT size=2><FONT style=": #e6e6e6"><strong><FONT face="Courier New"><FONT color=#808080>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><SPAN style="COLOR: green">// Advance the query. <o:p></o:p></SPAN></FONT></strong></FONT></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT style=": #e6e6e6" face="Courier New" color=#808080 size=2><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pagedQuery.NextPage();</strong></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT style=": #e6e6e6" face="Courier New" color=#808080 size=2><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</strong></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><strong><FONT size=2><FONT color=#808080><FONT style=": #e6e6e6"><FONT face="Courier New">&nbsp;&nbsp;&nbsp; }<SPAN style="COLOR: navy; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT></FONT></FONT></FONT></strong></P><P =Ms&#111;normal style="MARGIN: 8pt 0in 0pt"><FONT face="Times New Roman" size=2>The key points are:</FONT></P><OL style="MARGIN-TOP: 0in" =1><LI =Ms&#111;normal style="MARGIN: 8pt 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in"><FONT face="Times New Roman"><FONT size=2>Construct a paged query from another <I>ordered</I> query.</FONT><SPAN style="FONT-SIZE: 12pt"> </SPAN></FONT></LI><LI =Ms&#111;normal style="MARGIN: 8pt 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in"><FONT face="Times New Roman"><FONT size=2>Set the PageSize – the number of items to retrieve at a time (default is 25).</FONT><SPAN style="FONT-SIZE: 12pt"> </SPAN></FONT></LI><LI =Ms&#111;normal style="MARGIN: 8pt 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in"><FONT face="Times New Roman"><FONT size=2>Specify page overlapping – whether the last item of the page will be the first item on next page (default is true).</FONT><SPAN style="FONT-SIZE: 12pt"> </SPAN></FONT></LI><LI =Ms&#111;normal style="MARGIN: 8pt 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in"><FONT face="Times New Roman"><FONT size=2>Use NextPage, PrevPage, and CurrentPage to specify the result page to be returned when next query is executed.</FONT><SPAN style="FONT-SIZE: 12pt"> </SPAN></FONT></LI></OL>]]>
   </description>
   <pubDate>Wed, 06 Jun 2007 12:30:56 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=40&amp;PID=103#103</guid>
  </item> 
  <item>
   <title>Paged RdbQueries : Question:  How can I use a paged...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=40&amp;PID=102#102</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=20" rel="nofollow">Customer</a><br /><strong>Subject:</strong> 40<br /><strong>Posted:</strong> 06-Jun-2007 at 12:29pm<br /><br /><P style="MARGIN: 0in 0in 0pt" ="Questi&#111;n"><strong><EM><FONT face="Times New Roman" size=3>Question: </FONT></EM></strong></P><P style="MARGIN: 8pt 0in 0pt" ="Ms&#111;normal"><FONT face="Times New Roman" size=2>How can I use a paged RdbQuery for large result sets?</FONT></P><P>&nbsp;</P><span style="font-size:10px"><br /><br />Edited by Customer - 06-Jun-2007 at 12:29pm</span>]]>
   </description>
   <pubDate>Wed, 06 Jun 2007 12:29:15 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=40&amp;PID=102#102</guid>
  </item> 
 </channel>
</rss>