<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>.Net 技术</title>
        <link>http://blog.hidotnet.com/venjiang/category/1.aspx</link>
        <description>探索学习 .Net 技术</description>
        <language>zh-CN</language>
        <copyright>venjiang</copyright>
        <managingEditor>venjiang@msn.com</managingEditor>
        <generator>hiText Version 1.9.0.27</generator>
        <item>
            <title>Google 博客搜索 Ping 服务应用</title>
            <link>http://blog.hidotnet.com/venjiang/archive/2007/06/14/275.aspx</link>
            <description>&lt;img width="10" height="1" src="file:///clear.gif" alt="" /&gt;
&lt;p&gt;&lt;font size="-1"&gt;&lt;span style="background-color: rgb(0, 0, 255); color: rgb(255, 255, 255);"&gt;Google Ping 介绍&lt;/span&gt;&lt;br /&gt;
&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="-1"&gt;通 过 Google“博客搜索”Ping API, 用户可以程序化的方式将博客内容的更新通知给 Google“博客搜索”引擎。这对于经常更新博客内容的用户尤其有用。博客服务提供商的管理人员也可以利用此API将其平台上的博客内容变化向 Google 通告，以便 Google“博客搜索”及时抓取来自这一服务提供商的最新内容。为设置对 Google“博客搜索”的自动 Ping 机制，请按照如下所述设置XML-RPC客户端或REST客户端以发送请求。您可以任选一种方法进行通知；两者都将按照相同的方式进行处理。&lt;/font&gt;&lt;/p&gt;
&lt;br /&gt;
&lt;font size="-1"&gt; &lt;a name="about"&gt;&lt;/a&gt; &lt;/font&gt;
&lt;h1 style="margin-top: 10px;"&gt; &lt;font size="-1"&gt;
&lt;table width="100%" cellspacing="0" cellpadding="2" border="0"&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td style="border-top: 1px solid rgb(255, 158, 33); background-color: rgb(248, 223, 168);"&gt; &lt;font color="#000000"&gt;设置XML-RPC客户&lt;/font&gt;&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
&lt;/font&gt;&lt;/h1&gt;
&lt;p&gt;&lt;font size="-1"&gt;XML-RPC客户的请求应包含如下元素：&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="-1"&gt; &lt;strong&gt;RPC端点：&lt;/strong&gt; http://blogsearch.google.com/ping/RPC2 &lt;br /&gt;
&lt;strong&gt;调用方法名：&lt;/strong&gt;  weblogUpdates.extendedPing &lt;br /&gt;
&lt;strong&gt;参数：&lt;/strong&gt; (应按照如下所列的相同顺序传送)
&lt;ul&gt;
    &lt;li&gt; 站点名 &lt;/li&gt;
    &lt;li&gt; 站点URL &lt;/li&gt;
    &lt;li&gt; 需要检查更新的页面URL &lt;/li&gt;
    &lt;li&gt; 相应的RSS、RDF或Atom种子的URL &lt;/li&gt;
    &lt;li&gt; &lt;em&gt;可选&lt;/em&gt; 页面内容的分类名称(或标签)。您可以指定多个值，之间用'|'字符进行分隔。 &lt;/li&gt;
&lt;/ul&gt;
&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="-1"&gt; XML-RPC响应中将返回含有两个元素的&amp;lt;struct&amp;gt; ：
&lt;ul&gt;
    &lt;li&gt; flerror (Boolean)：当有错误发生时设为true/1 &lt;/li&gt;
    &lt;li&gt; message (string) ："Thanks for the ping." (如果成功) 或者一个错误信息(如果不成功)。 &lt;/li&gt;
&lt;/ul&gt;
&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="-1"&gt; &lt;strong&gt;XML-RPC请求的例子&lt;/strong&gt; &lt;/font&gt;&lt;/p&gt;
&lt;hr noshade="noshade" /&gt;
&lt;code&gt; &lt;/code&gt;
&lt;pre&gt;POST /RPC2 HTTP/1.0&lt;br /&gt;User-Agent: request&lt;br /&gt;Host: blogsearch.google.com&lt;br /&gt;Content-Type: text/xml&lt;br /&gt;Content-length: 447&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version="1.0"?&amp;gt;&lt;br /&gt;&amp;lt;methodCall&amp;gt;&lt;br /&gt;  &amp;lt;methodName&amp;gt;weblogUpdates.extendedPing&amp;lt;/methodName&amp;gt;&lt;br /&gt;  &amp;lt;params&amp;gt;&lt;br /&gt;    &amp;lt;param&amp;gt;&lt;br /&gt;      &amp;lt;value&amp;gt;Official Google Blog&amp;lt;/value&amp;gt;&lt;br /&gt;    &amp;lt;/param&amp;gt;&lt;br /&gt;    &amp;lt;param&amp;gt;&lt;br /&gt;      &amp;lt;value&amp;gt;http://googleblog.blogspot.com/&amp;lt;/value&amp;gt;&lt;br /&gt;    &amp;lt;/param&amp;gt;&lt;br /&gt;    &amp;lt;param&amp;gt;&lt;br /&gt;      &amp;lt;value&amp;gt;http://googleblog.blogspot.com/&amp;lt;/value&amp;gt;&lt;br /&gt;    &amp;lt;/param&amp;gt;&lt;br /&gt;    &amp;lt;param&amp;gt;&lt;br /&gt;      &amp;lt;value&amp;gt;http://googleblog.blogspot.com/atom.xml&amp;lt;/value&amp;gt;&lt;br /&gt;    &amp;lt;/param&amp;gt;&lt;br /&gt;  &amp;lt;/params&amp;gt;&lt;br /&gt;&amp;lt;/methodCall&amp;gt;&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;&lt;font size="-1"&gt;&lt;strong&gt;XML-RPC响应的例子&lt;/strong&gt;&lt;/font&gt; &lt;/p&gt;
&lt;hr noshade="noshade" /&gt;
&lt;code&gt; &lt;/code&gt;
&lt;pre&gt;HTTP/1.1 200 OK&lt;br /&gt;Connection: close&lt;br /&gt;Content-Length: 451&lt;br /&gt;Content-Type: text/xml&lt;br /&gt;Date: Sun, 30 Sep 2001 20:02:30 GMT&lt;br /&gt;Server: Apache&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version="1.0"?&amp;gt;&lt;br /&gt;&amp;lt;methodResponse&amp;gt;&lt;br /&gt;  &amp;lt;params&amp;gt;&lt;br /&gt;    &amp;lt;param&amp;gt;&lt;br /&gt;      &amp;lt;value&amp;gt;&lt;br /&gt;        &amp;lt;struct&amp;gt;&lt;br /&gt;          &amp;lt;member&amp;gt;&lt;br /&gt;            &amp;lt;name&amp;gt;flerror&amp;lt;/name&amp;gt;&lt;br /&gt;            &amp;lt;value&amp;gt;&lt;br /&gt;              &amp;lt;boolean&amp;gt;0&amp;lt;/boolean&amp;gt;&lt;br /&gt;            &amp;lt;/value&amp;gt;&lt;br /&gt;          &amp;lt;/member&amp;gt;&lt;br /&gt;          &amp;lt;member&amp;gt;&lt;br /&gt;            &amp;lt;name&amp;gt;message&amp;lt;/name&amp;gt;&lt;br /&gt;              &amp;lt;value&amp;gt;Thanks for the ping.&amp;lt;/value&amp;gt;&lt;br /&gt;          &amp;lt;/member&amp;gt;&lt;br /&gt;        &amp;lt;/struct&amp;gt;&lt;br /&gt;      &amp;lt;/value&amp;gt;&lt;br /&gt;    &amp;lt;/param&amp;gt;&lt;br /&gt;  &amp;lt;/params&amp;gt;&lt;br /&gt;&amp;lt;/methodResponse&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;font size="-1"&gt; &lt;a name="about"&gt;&lt;/a&gt; &lt;/font&gt;
&lt;h1 style="margin-top: 10px;"&gt; &lt;font size="-1"&gt;
&lt;table width="100%" cellspacing="0" cellpadding="2" border="0"&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td style="border-top: 1px solid rgb(255, 158, 33); background-color: rgb(248, 223, 168);"&gt; &lt;font color="#000000"&gt; 设置REST客户&lt;/font&gt;&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
&lt;/font&gt;&lt;/h1&gt;
&lt;p&gt;&lt;font size="-1"&gt;REST客户的请求中包含如下元素：&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="-1"&gt;&lt;strong&gt;URL:&lt;/strong&gt; http://blogsearch.google.com/ping&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="-1"&gt;&lt;strong&gt;参数:&lt;/strong&gt;
&lt;ul&gt;
    &lt;li&gt;name = 博客的名字&lt;/li&gt;
    &lt;li&gt;url = 博客的URL&lt;/li&gt;
    &lt;li&gt;changesURL = RSS、RDF或Atom种子的URL (可选)&lt;/li&gt;
&lt;/ul&gt;
响应中将返回文本内容，在成功的时候是"Thanks for the ping."，在失败时是一条错误消息。 &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="-1"&gt;&lt;strong&gt;例子：&lt;/strong&gt; &lt;/font&gt;&lt;/p&gt;
&lt;textarea cols="85" readonly="readonly"&gt;http://blogsearch.google.com/ping?name=Official+Google+Blog&amp;amp;url=http%3A%2F%2Fgoogleblog.blogspot.com%2F&amp;amp;changesURL=http%3A%2F%2Fgoogleblog.blogspot.com%2Fatom.xml &lt;/textarea&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h1 style="margin-top: 10px;"&gt; &lt;font size="-1"&gt;
&lt;table width="100%" cellspacing="0" cellpadding="2" border="0"&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td style="border-top: 1px solid rgb(255, 158, 33); background-color: rgb(248, 223, 168);"&gt; &lt;font color="#000000"&gt; changes.xml的格式&lt;/font&gt;&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
&lt;/font&gt;&lt;/h1&gt;
&lt;p&gt;&lt;font size="-1"&gt;Google 将所接受的“博客搜索” Ping 记录以XML格式发布到&lt;a href="http://blogsearch.google.com/changes.xml" target="_top"&gt;http://blogsearch.google.com/changes.xml&lt;/a&gt;。changes.xml文件格式包含一个根元素&amp;lt;weblogUpdates&amp;gt;和一个或多个的&amp;lt;weblog&amp;gt;元素。&lt;/font&gt;&lt;/p&gt;
&lt;pre&gt;&amp;lt;weblogUpdates version="2" updated="Wed, 30 May 2006 14:10:00 GMT" count="1384779"&amp;gt;&lt;br /&gt;  &amp;lt;weblog name="Some Blog"&lt;br /&gt;          url="http://googleblog.blogspot.com" &lt;br /&gt;          rssUrl="http://googleblog.blogspot.com/atom.xml"&lt;br /&gt;          when="1"/&amp;gt;&lt;br /&gt;  ...&lt;br /&gt;&amp;lt;/weblogUpdates&amp;gt;&lt;br /&gt;&lt;/pre&gt;
&lt;font size="-1"&gt;
&lt;h4&gt;&lt;a name="weblogUpdates_element"&gt; &amp;lt;weblogUpdates&amp;gt;元素&lt;/a&gt;&lt;/h4&gt;
&lt;/font&gt; &lt;font size="-1"&gt; &lt;/font&gt;
&lt;ul&gt;&lt;font size="-1"&gt;
    &lt;li&gt; &lt;strong&gt;version&lt;/strong&gt;：用来指示一个主要的格式变化，目前的版本是2。  &lt;/li&gt;
    &lt;li&gt; &lt;strong&gt;updated&lt;/strong&gt;：以 &lt;a href="http://www.w3.org/Protocols/rfc1945/rfc1945" target="_top"&gt;HTTP 1.0&lt;/a&gt;格式表示的日期时间。它指示了该文件上一次更新的时间。 &lt;/li&gt;
    &lt;li&gt; &lt;strong&gt;count&lt;/strong&gt;：一个递增的数字，表示了changes.xml文件的版本。新版本changes.xml文件通常具有更大的count值。 &lt;/li&gt;
    &lt;/font&gt;&lt;/ul&gt;
    &lt;p&gt;   &lt;font size="-1"&gt;
    &lt;h4&gt;&lt;a name="weblog_element"&gt; &amp;lt;weblog&amp;gt;元素 &lt;/a&gt;&lt;/h4&gt;
    &lt;/font&gt;  &lt;font size="-1"&gt;
    &lt;ul&gt;
        &lt;li&gt; &lt;strong&gt;name&lt;/strong&gt;：Blog的名称。 &lt;/li&gt;
        &lt;li&gt; &lt;strong&gt;url&lt;/strong&gt;： Blog的url。 &lt;/li&gt;
        &lt;li&gt; &lt;strong&gt;rssUrl&lt;/strong&gt;： 相应的RSS、Atom或其它种子的URL。 &lt;/li&gt;
        &lt;li&gt; &lt;strong&gt;when&lt;/strong&gt;： &amp;lt;weblogUpdates&amp;gt;元素的updated属性对应的时间减去相应的 Ping 发生的时间的差值，单位为秒。&lt;/li&gt;
    &lt;/ul&gt;
    ====================================================================&lt;/font&gt;&lt;/p&gt;
    &lt;p style="font-weight: bold; background-color: rgb(0, 0, 255); color: rgb(255, 255, 255);"&gt;&lt;font size="-1"&gt;下面实现如何使用XML RPC编程实现Google Ping服务.&lt;/font&gt;&lt;/p&gt;
    &lt;p&gt;&lt;font size="-1"&gt;首先,下载&lt;a href="http://www.xml-rpc.net/"&gt;CookComputing.XmlRpc&lt;/a&gt; &lt;br /&gt;
    &lt;/font&gt;&lt;/p&gt;
    &lt;p&gt;&lt;font size="-1"&gt;我使用的是2.0版本.最新版为2.1.0&lt;/font&gt;&lt;/p&gt;
    &lt;p style="font-weight: bold;"&gt;1.建立xml rpc客户端&lt;/p&gt;
    &lt;p&gt; public class GoogleXmlRpc&lt;br /&gt;
        {&lt;br /&gt;
            /// &amp;lt;summary&amp;gt;&lt;br /&gt;
            /// 返回值,用于处理Google Ping返回值的结构&lt;br /&gt;
            /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
            public struct ReturnValue&lt;br /&gt;
            {&lt;br /&gt;
                public bool flerror;&lt;br /&gt;
                public string message;&lt;br /&gt;
            }&lt;br /&gt;
    &lt;br /&gt;
            [XmlRpcUrl("http://blogsearch.google.com/ping/RPC2")]&lt;br /&gt;
            public interface IGooglePing : IXmlRpcProxy&lt;br /&gt;
            {&lt;br /&gt;
                [XmlRpcMethod("weblogUpdates.extendedPing")]&lt;br /&gt;
                ReturnValue Ping(string websiteName, string websiteUrl, string changedUrl, string feedUrl);&lt;br /&gt;
            }&lt;br /&gt;
            &lt;br /&gt;
        }&lt;/p&gt;
    &lt;br /&gt;
    &lt;p style="font-weight: bold;"&gt;2.向Google发出一个ping通告&lt;/p&gt;
    &lt;p&gt;在你的程序添加文章或更新文章时,发出ping通告.&lt;/p&gt;
    &lt;p&gt;        string websiteName="venjiang 的博客";                                                    // 博客名称&lt;br /&gt;
            string websiteUrl="http://blog.hidotnet.com/venjiang/";        // 博客网站地址&lt;br /&gt;
            string changeUrl = "http://blog.hidotnet.com/venjiang/";                             // 要更新的地址&lt;br /&gt;
            string feedUrl = "http://blog.hidotnet.com/venjiang/Rss.aspx";             // 聚合地址rss或atom&lt;/p&gt;
    &lt;p&gt;        GoogleXmlRpc.IGooglePing proxy = (GoogleXmlRpc.IGooglePing)XmlRpcProxyGen.Create(typeof(GoogleXmlRpc.IGooglePing));    // 创建代理类&lt;/p&gt;
    &lt;p&gt;        // 最新版本,支持泛型,可以直接使用: &lt;br /&gt;
    &lt;/p&gt;
    &lt;p&gt;       // GoogleXmlRpc.IGooglePing proxy =XmlRpcProxyGen.Create&amp;lt;GoogleXmlRpc.IGooglePing&amp;gt;();&lt;/p&gt;
    &lt;p&gt;        GoogleXmlRpc.ReturnValue returnValue = proxy.Ping(websiteName, websiteUrl, changeUrl, feedUrl);    // ping&lt;br /&gt;
    &lt;/p&gt;
    &lt;p&gt;        if (returnValue.flerror)&lt;br /&gt;
                Response.Write( "Google Ping 出错!");&lt;br /&gt;
            else&lt;br /&gt;
                Response.Write "Google Ping 成功!";&lt;/p&gt;
    &lt;br /&gt;
    &lt;p style="font-weight: bold;"&gt;3.查看google 更新列表&lt;/p&gt;
    &lt;p&gt;下载:&lt;font size="-1"&gt;&lt;a href="http://blogsearch.google.com/changes.xml" target="_top"&gt;http://blogsearch.google.com/changes.xml&lt;/a&gt; 你可以看到你的博客相关信息已加入更新列表,目前google更新列表,有一定延迟.&lt;br /&gt;
    &lt;/font&gt;&lt;/p&gt;&lt;img src="http://blog.hidotnet.com/venjiang/aggbug/275.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>venjiang</dc:creator>
            <guid>http://blog.hidotnet.com/venjiang/archive/2007/06/14/275.aspx</guid>
            <pubDate>Thu, 14 Jun 2007 17:02:49 GMT</pubDate>
            <wfw:comment>http://blog.hidotnet.com/venjiang/comments/275.aspx</wfw:comment>
            <comments>http://blog.hidotnet.com/venjiang/archive/2007/06/14/275.aspx#feedback</comments>
            <slash:comments>1757</slash:comments>
            <wfw:commentRss>http://blog.hidotnet.com/venjiang/comments/commentRss/275.aspx</wfw:commentRss>
            <trackback:ping>http://blog.hidotnet.com/venjiang/services/trackbacks/275.aspx</trackback:ping>
        </item>
        <item>
            <title>安装Visual Studio 2005 Service Pack 1</title>
            <link>http://blog.hidotnet.com/venjiang/archive/2006/12/18/78.aspx</link>
            <description>前几日jacky告诉我vs2k5 sp1出了,随即下载.今日抽空赶紧安装.&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;
&lt;br /&gt;
准备环境:&lt;/span&gt;&lt;br /&gt;
Microsoft? Visual Studio? 2005 Service Pack 1&lt;br /&gt;
&lt;br /&gt;
下面为中文版&lt;br /&gt;
下载地址:&lt;br /&gt;
Microsoft? Visual Studio? 2005 Service Pack 1&lt;br /&gt;
下载地址:&lt;br /&gt;
http://www.microsoft.com/downloads/details.aspx?FamilyID=bb4a75ab-e2d4-4c96-b39d-37baf6b5b1dc&amp;amp;DisplayLang=zh-cn&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;
&lt;li&gt;&lt;strong&gt;安装要求：&lt;/strong&gt;
&lt;ul&gt;
    &lt;li&gt;目标计算机上必须安装了受支持的 Visual Studio® 2005 产品副本。&lt;/li&gt;
    &lt;li&gt;目标计算机上安装了 Microsoft® Windows® Installer 3.1 或更高版本。&lt;/li&gt;
    &lt;li&gt;至少 192MB 的 RAM。建议使用 256MB 或更大内存。&lt;/li&gt;
    &lt;li&gt;硬盘空间至少为 6.2GB
    &lt;ul&gt;
        &lt;li&gt;如果目标计算机上安装了多个 Visual Studio® 2005 产品，硬盘空间要求也会相应大大增加。&lt;/li&gt;
    &lt;/ul&gt;
    &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: rgb(255, 0, 0);"&gt;安装可能出现问题解决办法:&lt;/span&gt;&lt;br /&gt;
http://support.microsoft.com/kb/925336  &lt;br /&gt;
&lt;br /&gt;
几个朋友提示安装过程费了些周折,为避免安装出现问题,请按上面的方法,先修改本地安全策略.&lt;br /&gt;
M$这个要求有6G空间,这个实在有些愁人,一些朋友也因空间问题安装出错,抓紧整理我的硬盘空间,但资料实在太多,一时半日无法整理出6G空间.一个补丁400M,干嘛要求这么多空间,M$不是在折腾我们嘛. 决定尝试安装.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;安装前环境:&lt;br /&gt;
&lt;/span&gt;剩余空间:&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;
&lt;/span&gt;C: 3.88G&lt;br /&gt;
D: 3.57G&lt;br /&gt;
&lt;br /&gt;
Visual Studio 2005 安装在D盘,临时文件夹在C盘,如果你有修改系统临时文件夹路径,确保所在盘有足够空间.&lt;br /&gt;
Visual Studio 2005我是重新安装的,没有安装VB,VC++,其余都有安装.上面所列硬盘空间容量为安装VS2005后剩余.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;安装过程中:&lt;br /&gt;
&lt;/span&gt;剩余空间:&lt;br /&gt;
C: 2.54G &lt;br /&gt;
临时文件写入,然后开始收集信息,过程比较漫长.这个时间你可以去看电视了.或者干脆小睡一会儿,不知道M$花这么长时间收集什么,小心把电脑里的MM搜集走. 在这个过程中,临时文件夹写入450多M,C盘其它地方写入不到1G, 任务管理器查看,整个SP1补丁被全部载入内存,安装程序占用CPU 50%左右.为避免出现什么异外,建议不要开太多程序.&lt;br /&gt;
&lt;img src="http://blog.hidotnet.com/images/blog_hidotnet_com/venjiang/12/r_Install1.jpg" alt="" /&gt;&lt;br /&gt;
&lt;br /&gt;
搜集完信息,开始安装....&lt;br /&gt;
&lt;img src="http://blog.hidotnet.com/images/blog_hidotnet_com/venjiang/12/r_Install2.jpg" alt="" /&gt;&lt;br /&gt;
这个时间不准确,可以去抽颗烟,喝杯咖啡.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;安装完成后:&lt;/span&gt;&lt;br /&gt;
剩余空间:&lt;br /&gt;
C: 2.98G&lt;br /&gt;
D: 3.56G&lt;br /&gt;
&lt;img src="http://blog.hidotnet.com/images/blog_hidotnet_com/venjiang/12/r_Install3.jpg" alt="" /&gt;&lt;br /&gt;
&lt;br /&gt;
VS2005版本&lt;br /&gt;
&lt;img src="http://blog.hidotnet.com/images/blog_hidotnet_com/venjiang/12/r_Install4.jpg" alt="" /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;总结:&lt;/span&gt;&lt;br /&gt;
整个过程安装比较顺利,可以看到在搜集信息时,C盘写入1.34G,安装完成后,删除了临时文件,减少450M,D盘,也就是VS2005所在文件夹写入信息并不多.这样看来,如果只安装C#版本的VS,打补丁,C盘有1.5G应该足够了,VS2005安装所在目录并不需要太多空间.当然,如果你的VS2005安装的组件比较多的话,相应空间要求会提高不少.但至少6G这个要求并不是必须的.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;测试:&lt;/span&gt;&lt;br /&gt;
终于可以在中文版上运行Web Application Project了.&lt;br /&gt;
新建:&lt;br /&gt;
&lt;img src="http://blog.hidotnet.com/images/blog_hidotnet_com/venjiang/12/r_Install5.jpg" alt="" /&gt;&lt;br /&gt;
&lt;br /&gt;
项目解决方案:&lt;br /&gt;
&lt;img src="http://blog.hidotnet.com/images/blog_hidotnet_com/venjiang/12/r_Install6.jpg" alt="" /&gt;&lt;br /&gt;
&lt;br /&gt;
编译:&lt;br /&gt;
&lt;img src="http://blog.hidotnet.com/images/blog_hidotnet_com/venjiang/12/r_Install7.jpg" alt="" /&gt;&lt;br /&gt;
&lt;br /&gt;
运行:&lt;br /&gt;
&lt;img src="http://blog.hidotnet.com/images/blog_hidotnet_com/venjiang/12/r_Install8.jpg" alt="" /&gt;&lt;br /&gt;
&lt;br /&gt;
另.打开先前M$提供的Web Application Project 项目,可以成功加载.&lt;br /&gt;
&lt;br /&gt;
至此,Visual Studio? 2005 Service Pack 1安装完毕.&lt;br /&gt;
&lt;img src="/Providers/BlogEntryEditor/FCKeditor/editor/images/smiley/msn/wink_smile.gif" alt="" /&gt;&lt;img src="http://blog.hidotnet.com/venjiang/aggbug/78.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>venjiang</dc:creator>
            <guid>http://blog.hidotnet.com/venjiang/archive/2006/12/18/78.aspx</guid>
            <pubDate>Mon, 18 Dec 2006 03:02:50 GMT</pubDate>
            <wfw:comment>http://blog.hidotnet.com/venjiang/comments/78.aspx</wfw:comment>
            <comments>http://blog.hidotnet.com/venjiang/archive/2006/12/18/78.aspx#feedback</comments>
            <slash:comments>848</slash:comments>
            <wfw:commentRss>http://blog.hidotnet.com/venjiang/comments/commentRss/78.aspx</wfw:commentRss>
            <trackback:ping>http://blog.hidotnet.com/venjiang/services/trackbacks/78.aspx</trackback:ping>
        </item>
        <item>
            <title>测试</title>
            <link>http://blog.hidotnet.com/venjiang/archive/2006/12/13/77.aspx</link>
            <description>&lt;a href="http://blog.csdn.net/zdg/archive/2006/12/12/1439158.aspx"&gt;BSP防范Trackback垃圾的一种方法&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;&lt;a id="viewpost1_TitleUrl" href="http://www.cnblogs.com/venjiang/archive/2005/04/14/137638.html"&gt;发布Asp.Net Forums V2.2.1929 官方中文Beta版&lt;/a&gt;&lt;/h2&gt;
&lt;br /&gt;
&lt;br /&gt;
测试trackback&lt;img src="http://blog.hidotnet.com/venjiang/aggbug/77.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>venjiang</dc:creator>
            <guid>http://blog.hidotnet.com/venjiang/archive/2006/12/13/77.aspx</guid>
            <pubDate>Wed, 13 Dec 2006 02:40:06 GMT</pubDate>
            <wfw:comment>http://blog.hidotnet.com/venjiang/comments/77.aspx</wfw:comment>
            <comments>http://blog.hidotnet.com/venjiang/archive/2006/12/13/77.aspx#feedback</comments>
            <slash:comments>1538</slash:comments>
            <wfw:commentRss>http://blog.hidotnet.com/venjiang/comments/commentRss/77.aspx</wfw:commentRss>
            <trackback:ping>http://blog.hidotnet.com/venjiang/services/trackbacks/77.aspx</trackback:ping>
        </item>
        <item>
            <title>BlogML 2.0 is Released</title>
            <link>http://blog.hidotnet.com/venjiang/archive/2006/10/25/49.aspx</link>
            <description>BlogML是什么?&lt;br /&gt;
BlogML是blog内容的XML格式存储,你能够使用它归档blog内容,或者作为博客转换/迁移的标准格式.当前已有数个blog引擎提供了这个支持.&lt;br /&gt;
&lt;span id="ctl00_ctl00_Content_Main_wikiSourceLabel"&gt;
&lt;ul&gt;
    &lt;li&gt;Community Server&lt;/li&gt;
    &lt;li&gt;Das Blog&lt;/li&gt;
    &lt;li&gt;Subtext&lt;/li&gt;
    &lt;li&gt;SingleUserBlog&lt;/li&gt;
&lt;/ul&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
你能够在&lt;a href="http://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=BlogML&amp;amp;ReleaseId=171"&gt;这里下载&lt;/a&gt; BlogML 2.0.&lt;img src="http://blog.hidotnet.com/venjiang/aggbug/49.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>venjiang</dc:creator>
            <guid>http://blog.hidotnet.com/venjiang/archive/2006/10/25/49.aspx</guid>
            <pubDate>Wed, 25 Oct 2006 11:15:04 GMT</pubDate>
            <wfw:comment>http://blog.hidotnet.com/venjiang/comments/49.aspx</wfw:comment>
            <comments>http://blog.hidotnet.com/venjiang/archive/2006/10/25/49.aspx#feedback</comments>
            <slash:comments>8664</slash:comments>
            <wfw:commentRss>http://blog.hidotnet.com/venjiang/comments/commentRss/49.aspx</wfw:commentRss>
            <trackback:ping>http://blog.hidotnet.com/venjiang/services/trackbacks/49.aspx</trackback:ping>
        </item>
        <item>
            <title> SqlServer数据访问帮助类 for .Net 2.0</title>
            <link>http://blog.hidotnet.com/venjiang/archive/2006/10/13/29.aspx</link>
            <description>&lt;p&gt;=================================================================&lt;br /&gt;
// SqlServer数据访问帮助类&lt;br /&gt;
=================================================================&lt;br /&gt;
// 名字空间: hiDotNet.Data&lt;br /&gt;
// 描    述: SqlServer数据访问帮助类.&lt;br /&gt;
// 日    期: 2006年3月14日&lt;br /&gt;
// 修订日期: 2006年3月17日&lt;br /&gt;
// 联    系: &lt;a href="mailto:venjiang@msn.com"&gt;venjiang@msn.com&lt;/a&gt;&lt;br /&gt;
// 说    明: 实现SqlServer的快速访问&lt;br /&gt;
=================================================================&lt;br /&gt;
// 版权所有,hiDotNet.com 更多内容请访问: &lt;a href="http://www.hidotnet.com/"&gt;www.hiDotNet.com&lt;/a&gt;&lt;br /&gt;
=================================================================&lt;/p&gt;
&lt;p&gt;[示例运行环境]&lt;br /&gt;
.Net Framework 2.0&lt;br /&gt;
Sql Server 2000&lt;/p&gt;
&lt;p&gt;[步骤]&lt;br /&gt;
1.执行SetupDataBase.bat,安装示例数据库所需内容.&lt;br /&gt;
2.使用Vs2005打开SqlHelperTest.csproj,编译运行.&lt;br /&gt;
&lt;br /&gt;
&lt;font color="#ff0000"&gt;欢迎测试反馈.&lt;br /&gt;
&lt;/font&gt;&lt;font color="#000000"&gt;示例截图:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#000000"&gt;&lt;img alt="" src="http://blog.hidotnet.com/images/blog_hidotnet_com/venjiang/12/r_SqlHelper_Example.jpg" /&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#000000"&gt;帮助&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#000000"&gt;&lt;img alt="" src="http://blog.hidotnet.com/images/blog_hidotnet_com/venjiang/12/r_SqlHelp_Help.jpg" /&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;font color="#000000"&gt;&lt;a href="http://bbs.hidotnet.com/PostAttachment.aspx?PostID=22380&amp;amp;AttachmentID=736" target="_blank"&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;点击下载&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blog.hidotnet.com/venjiang/aggbug/29.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>venjiang</dc:creator>
            <guid>http://blog.hidotnet.com/venjiang/archive/2006/10/13/29.aspx</guid>
            <pubDate>Fri, 13 Oct 2006 23:06:54 GMT</pubDate>
            <wfw:comment>http://blog.hidotnet.com/venjiang/comments/29.aspx</wfw:comment>
            <comments>http://blog.hidotnet.com/venjiang/archive/2006/10/13/29.aspx#feedback</comments>
            <slash:comments>577</slash:comments>
            <wfw:commentRss>http://blog.hidotnet.com/venjiang/comments/commentRss/29.aspx</wfw:commentRss>
            <trackback:ping>http://blog.hidotnet.com/venjiang/services/trackbacks/29.aspx</trackback:ping>
        </item>
        <item>
            <title>关于Cache的疑惑</title>
            <link>http://blog.hidotnet.com/venjiang/archive/2006/10/11/17.aspx</link>
            <description>Cache.Insert("CacheKey", value, null, DateTime.Now.AddSeconds(30), TimeSpan.Zero, CacheItemPriority.Normal, null);&lt;br /&gt;
&lt;br /&gt;
Cache.Insert("CacheKey", value, null, DateTime.Now.AddSeconds(30), System.Web.Caching.Cache.NoSlidingExpiration, CacheItemPriority.Normal, null);&lt;br /&gt;
&lt;br /&gt;
前者很少有命中.&lt;br /&gt;
后者才是按时间命中.&lt;br /&gt;
&lt;br /&gt;
System.Web.Caching.Cache.NoSlidingExpiration实际也是设置为TimeSpan.Zero.&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;MSDN如是说:&lt;/span&gt;&lt;br /&gt;
使用后，该字段将 slidingExpiration 参数设置成 TimeSpan.Zero 字段，该字段具有常数值零。缓存项依照与 Insert 或 Add 方法调用相关的 absoluteExpiration 参数设置过期。&lt;br /&gt;
&lt;br /&gt;
无法同时设置 absoluteExpiration 和 slidingExpiration 参数。如果要让缓存项在特定时间过期，可将 absoluteExpiration 参数设置为特定时间，并将 slidingExpiration 参数设置为 NoSlidingExpiration。&lt;br /&gt;
&lt;br /&gt;
如果要让缓存项自最后一次访问该项后的某段时间之后过期，可将 slidingExpiration 参数设置为过期间隔，并将 absoluteExpiration 参数设置为 NoAbsoluteExpiration。&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;MSDN:示例&lt;/span&gt;&lt;br /&gt;
Cache.Insert("DSN", connectionString, null, DateTime.Now.AddMinutes(2), TimeSpan.Zero, CacheItemPriority.High, onRemove);&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
而这种方法,用户访问后,立即过期,缓存实际上根本无法命中.&lt;br /&gt;
MSDN上的示例都是如此.&lt;br /&gt;
&lt;br /&gt;
?????&lt;br /&gt;
 &lt;img src="http://blog.hidotnet.com/venjiang/aggbug/17.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>venjiang</dc:creator>
            <guid>http://blog.hidotnet.com/venjiang/archive/2006/10/11/17.aspx</guid>
            <pubDate>Wed, 11 Oct 2006 16:35:33 GMT</pubDate>
            <wfw:comment>http://blog.hidotnet.com/venjiang/comments/17.aspx</wfw:comment>
            <comments>http://blog.hidotnet.com/venjiang/archive/2006/10/11/17.aspx#feedback</comments>
            <slash:comments>596</slash:comments>
            <wfw:commentRss>http://blog.hidotnet.com/venjiang/comments/commentRss/17.aspx</wfw:commentRss>
            <trackback:ping>http://blog.hidotnet.com/venjiang/services/trackbacks/17.aspx</trackback:ping>
        </item>
        <item>
            <title>hiDotNet博客开通</title>
            <link>http://blog.hidotnet.com/venjiang/archive/2006/10/11/13.aspx</link>
            <description>测试期...&lt;br /&gt;
&lt;br /&gt;
目标,将建立成高负载的博客系统,分布式缓存策略等.&lt;br /&gt;
&lt;br /&gt;
开篇纪念.&lt;img src="http://blog.hidotnet.com/venjiang/aggbug/13.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>venjiang</dc:creator>
            <guid>http://blog.hidotnet.com/venjiang/archive/2006/10/11/13.aspx</guid>
            <pubDate>Wed, 11 Oct 2006 16:26:22 GMT</pubDate>
            <wfw:comment>http://blog.hidotnet.com/venjiang/comments/13.aspx</wfw:comment>
            <comments>http://blog.hidotnet.com/venjiang/archive/2006/10/11/13.aspx#feedback</comments>
            <slash:comments>2309</slash:comments>
            <wfw:commentRss>http://blog.hidotnet.com/venjiang/comments/commentRss/13.aspx</wfw:commentRss>
            <trackback:ping>http://blog.hidotnet.com/venjiang/services/trackbacks/13.aspx</trackback:ping>
        </item>
        <item>
            <title>Stored procedures: Implement full text search</title>
            <link>http://blog.hidotnet.com/venjiang/archive/2006/10/11/5.aspx</link>
            <description>&lt;p&gt;Enabling full text search in T-SQL is not as popular as doing it with the Enterprise Manager. Nonetheless, it can be useful in certain situations. Here are the steps to implement FTS in T-SQL. &lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;Enable full text on the database by executing the following SP:
    &lt;pre&gt;EXEC sp_fulltext_database  'enable' &lt;br /&gt;&lt;/pre&gt;
    &lt;/li&gt;
    &lt;li&gt;Create the catalog (if it does not exist):
    &lt;pre&gt;EXEC sp_fulltext_catalog   'MyCatalog','create'  &lt;br /&gt;&lt;/pre&gt;
    &lt;/li&gt;
    &lt;li&gt;Add a full text index on a table:
    &lt;pre&gt;EXEC sp_fulltext_table     'Products', 'create', 'MyCatalog', 'pk_products'&lt;br /&gt;EXEC sp_fulltext_table     'Categories', 'create', 'MyCatalog', 'pk_categories'&lt;br /&gt;&lt;/pre&gt;
    &lt;/li&gt;
    &lt;li&gt;Add a column to the full text index:
    &lt;pre&gt;EXEC sp_fulltext_column    'Products', 'ProductName', 'add' &lt;br /&gt;EXEC sp_fulltext_column    'Categories', 'Description', 'add' &lt;br /&gt;&lt;/pre&gt;
    &lt;/li&gt;
    &lt;li&gt;Activate the index:
    &lt;pre&gt;EXEC sp_fulltext_table     'Products','activate'&lt;br /&gt;EXEC sp_fulltext_table     'Categories','activate'&lt;br /&gt;&lt;/pre&gt;
    &lt;/li&gt;
    &lt;li&gt;Start full population:
    &lt;pre&gt;EXEC sp_fulltext_catalog   'MyCatalog', 'start_full' &lt;br /&gt;&lt;/pre&gt;
    &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Here are some examples on how to use this procedure:&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;
    &lt;pre&gt;USE Northwind&lt;br /&gt;GO&lt;br /&gt;SELECT ProductId, ProductName, UnitPrice&lt;br /&gt;FROM Products&lt;br /&gt;WHERE CONTAINS(  &lt;br /&gt;                    ProductName, ' "sasquatch " OR "stout" '&lt;br /&gt;                                )&lt;br /&gt;GO&lt;br /&gt;&lt;/pre&gt;
    &lt;/li&gt;
    &lt;li&gt;
    &lt;pre&gt;USE Northwind&lt;br /&gt;GO&lt;br /&gt;SELECT CategoryName&lt;br /&gt;FROM Categories&lt;br /&gt;FREETEXT (&lt;br /&gt;                    Description, 'sweetest candy bread and dry meat'&lt;br /&gt;                   )&lt;br /&gt;GO&lt;/pre&gt;
    &lt;/li&gt;
&lt;/ol&gt;&lt;img src="http://blog.hidotnet.com/venjiang/aggbug/5.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>venjiang</dc:creator>
            <guid>http://blog.hidotnet.com/venjiang/archive/2006/10/11/5.aspx</guid>
            <pubDate>Wed, 11 Oct 2006 15:36:15 GMT</pubDate>
            <wfw:comment>http://blog.hidotnet.com/venjiang/comments/5.aspx</wfw:comment>
            <comments>http://blog.hidotnet.com/venjiang/archive/2006/10/11/5.aspx#feedback</comments>
            <slash:comments>316</slash:comments>
            <wfw:commentRss>http://blog.hidotnet.com/venjiang/comments/commentRss/5.aspx</wfw:commentRss>
            <trackback:ping>http://blog.hidotnet.com/venjiang/services/trackbacks/5.aspx</trackback:ping>
        </item>
        <item>
            <title>Custom Paging in ASP.NET 2.0 with SQL Server 2005</title>
            <link>http://blog.hidotnet.com/venjiang/archive/2006/10/11/4.aspx</link>
            <description>This article highlights features new to SQL Server 2005 that make retrieving a particular paged subset of data incredibly easy and efficient. For those who've yet to switch to SQL Server 2005, check out &lt;a href="http://venjiang.sogot.com/ct.ashx?id=10c0c4a9-f83c-4a90-9069-b0325eae43da&amp;amp;url=http%3a%2f%2fwww.4guysfromrolla.com%2fwebtech%2f042606-1.shtml"&gt;A More Efficient Method for Paging Through Large Result Sets&lt;/a&gt;. The stored procedure presented in that article can be plugged in for the stored procedure examined in this article if needed.
&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;br /&gt;
A common pattern in web development is providing paged access to data. Rather than displaying the entire contents of a report or database table to an end user, developers often show only a subset of records per web page, with controls for moving from page to page. With ASP.NET 1.x, &lt;a href="http://venjiang.sogot.com/ct.ashx?id=10c0c4a9-f83c-4a90-9069-b0325eae43da&amp;amp;url=http%3a%2f%2faspnet.4guysfromrolla.com%2farticles%2f070903-1.aspx"&gt;the DataGrid made paging incredibly simple&lt;/a&gt; - just set the &lt;code&gt;AllowPaging&lt;/code&gt; property to True and add a few lines of code in the &lt;code&gt;PageIndexChanged&lt;/code&gt; event handler and you were done! &lt;a href="http://venjiang.sogot.com/ct.ashx?id=10c0c4a9-f83c-4a90-9069-b0325eae43da&amp;amp;url=http%3a%2f%2faspnet.4guysfromrolla.com%2f2.0%2f"&gt;ASP.NET 2.0&lt;/a&gt;'s &lt;a href="http://venjiang.sogot.com/ct.ashx?id=10c0c4a9-f83c-4a90-9069-b0325eae43da&amp;amp;url=http%3a%2f%2fmsdn.microsoft.com%2flibrary%2fdefault.asp%3furl%3d%2flibrary%2fen-us%2fdnaspp%2fhtml%2fGridViewEx.asp"&gt;GridView&lt;/a&gt; makes the process even simpler - just check the Enable Paging option from the GridView's smart tag - no code needed.  &lt;/p&gt;
&lt;p&gt;Of course nothing is free in life, and the tradeoff you make with the ease of checking a checkbox to enable paging (or, in the DataGrid's case, writing a couple lines of code) is performance. Out of the box, the DataGrid and GridView use &lt;em&gt;default paging&lt;/em&gt;, which is a simple paging model that returns &lt;em&gt;all&lt;/em&gt; of the records for each every page of data shown. When paging through small amounts of data (dozens to a hundred or so records), this inefficiency is likely outweighed by the ease of adding the feature. However, if you want to page through thousands, tens of thousands, or hundreds of thousands of records the default paging model is not viable. &lt;/p&gt;
&lt;p&gt;The alternative to default paging is &lt;em&gt;custom paging&lt;/em&gt;, in which you are tasked with writing code that intelligently grabs the correct subset of data. It requires a bit more work, but is essential when dealing with sufficiently-sized data. I discuss how to implement custom paging in ASP.NET 1.x in my book &lt;a href="http://venjiang.sogot.com/ct.ashx?id=10c0c4a9-f83c-4a90-9069-b0325eae43da&amp;amp;url=http%3a%2f%2fwww.4guysfromrolla.com%2fASPScripts%2fGoto.asp%3fID%3d148"&gt;&lt;em&gt;ASP.NET Data Web Controls Kick Start&lt;/em&gt;&lt;/a&gt;. In this article we'll look at how to implement custom paging in ASP.NET 2.0 using SQL Server 2005's new &lt;code&gt;ROW_NUMBER()&lt;/code&gt; feature. (For more information on SQL Server's new ranking features, including &lt;code&gt;ROW_NUMBER()&lt;/code&gt;, see &lt;a href="http://venjiang.sogot.com/ct.ashx?id=10c0c4a9-f83c-4a90-9069-b0325eae43da&amp;amp;url=http%3a%2f%2fwww.4guysfromrolla.com%2fwebtech%2f010406-1.shtml"&gt;Returning Ranked Results with Microsoft SQL Server 2005&lt;/a&gt;.)  &lt;/p&gt;
&lt;p&gt;Read on to learn more! &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Default Paging vs. Custom Paging&lt;/strong&gt;&lt;br /&gt;
The GridView in 2.0 (and the DataGrid in 1.x) offers two paging models: default paging and custom paging. The two models provide a tradeoff between performance and ease of setting up/configuring/using. The SqlDataSource control uses default paging (although you can wrestle it into using custom paging); the ObjectDataSource uses default paging by default, but has an easy mechanism to indicate that it should use custom paging. Keep in mind that the GridView merely displays data; it's the GridView's data source control that is actually retrieving data from the database. &lt;/p&gt;
&lt;p&gt;With default paging, each time a new page of data in displayed in the GridView, &lt;em&gt;all&lt;/em&gt; of the data is requeried from the and returned from the GridView's data source. Once all of the data has been returned, the GridView selectively displays part of the entire set of data, based on the page of data the user is viewing and how many records per page are displayed. The key thing to understand here is that every single time a page of data is loaded - be it on the first page visit when viewing the first page of data or when the user postsbacks after requesting to view a different page of data - the &lt;em&gt;entire&lt;/em&gt; data result is retrieved.  &lt;/p&gt;
&lt;p&gt;For example, imagine that you work at an eCommerce company and you want to allow the user to page through a list of the 150 products your company sells. Specifically, you want to display 10 records per page. Now, when a user visits the web page, all 150 records will be returned by the data source control, but the GridView will display the first 10 products (products 1 to 10). Next, imagine that the user navigates to the next page of data. This will cause a postback, at which point the GridView will rerequest all 150 records from the data source control, but this time only display the second set of 10 (products 11 to 20). &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;table align="center" class="noteBox"&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;th&gt;Caching and the SqlDataSource&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;The SqlDataSource allows for the DataSet it returns to be cached by simply setting the &lt;code&gt;EnableCaching&lt;/code&gt; property. With a cached DataSet, stepping to another page does not require the database be requiried since the data being paged through is cached in memory. However, on the initial page load the same problem arises - &lt;em&gt;all&lt;/em&gt; of the data must be loaded into the cached DataSet. Furthermore, you must worry about stale data with this approach (although if you use SQL cache dependencies, then this point is moot).
            &lt;p&gt;Even with caching the DataSet, my unscientific tests found custom paging to be twice as fast... When we examine the performance metrics later, though, you'll see that this cached approach far outshines the non-cached approach. (But it still doesn't beat the custom paging approach!) &lt;/p&gt;
            &lt;p&gt;For more on caching the DataSet returned by the SqlDataSource see &lt;a href="http://venjiang.sogot.com/ct.ashx?id=10c0c4a9-f83c-4a90-9069-b0325eae43da&amp;amp;url=http%3a%2f%2fmsdn2.microsoft.com%2fen-us%2flibrary%2fz56y8ksb.aspx"&gt;Caching Data With the SqlDataSource&lt;/a&gt;. &lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;With custom paging, you, the developer, have to do a bit more work. Rather than just being able to blindly bind the GridView to a data source control and check the "Enable Paging" checkbox, you have to configure the data source control to selectively retrieve only those records that should be shown for the particular page. The benefit of this is that when displaying the first page of data, you can use a SQL statement that only retrieves products 1 through 10, rather than all 150 records. However, your SQL statement has to be "clever" enough to be able to know how to just snip out the right subset of records from the 150. &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;table align="center" class="noteBox"&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;th&gt;The Performance Edge of Custom Paging&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;Realize that custom paging provides better performance than default paging because only those database records that need to be displayed are retrieved. In our products example, we assumed there were 150 products, showing 10 per page. With custom paging, if the user stepped through all 15 pages of data, precisely 150 records would have been queried from the database. With default paging, however, for each page of data, 150 records would have been accessed, leading to a total number of retrieved records of 15 times 150, or 2,250!
            &lt;p&gt;While custom paging exhibits better performance, default paging is much easier to use. Therefore, I would encourage you to use default paging if the data you are paging through is relatively small and/or the database server is not heavily trafficked. If you have several hundred, thousands, or tens of thousands of records you are paging through, by all means use custom paging. However, for paging through something like the ASPFAQs.com database, which only has, currently, ~200 FAQs, default paging is sufficient. &lt;/p&gt;
            &lt;p&gt;(Of course, if you use default paging on a small table with, say, 75 records, you are assuming that over time the table's row count will stay low. There will be some unhappy customers if you use default paging on that small table which later grows to be a table with 7,500 records!) &lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;Efficiently Getting Back a Page of Data with SQL Server 2005&lt;/strong&gt;&lt;br /&gt;
As discussed in an earlier 4Guys article, &lt;a href="http://venjiang.sogot.com/ct.ashx?id=10c0c4a9-f83c-4a90-9069-b0325eae43da&amp;amp;url=http%3a%2f%2fwww.4guysfromrolla.com%2fwebtech%2f010406-1.shtml"&gt;Returning Ranked Results with Microsoft SQL Server 2005&lt;/a&gt;, SQL Server 2005 introduces a number of new keywords for returning ranked results. In particular, &lt;a href="http://venjiang.sogot.com/ct.ashx?id=10c0c4a9-f83c-4a90-9069-b0325eae43da&amp;amp;url=http%3a%2f%2fmsdn2.microsoft.com%2fen-us%2flibrary%2fms186734%28sql.90%29.aspx"&gt;the &lt;code&gt;ROW_NUMBER()&lt;/code&gt; keyword&lt;/a&gt; enables us to associate a sequentially-increasing row number for the results returned. We can use &lt;code&gt;ROW_NUMBER()&lt;/code&gt;, then, to get a particular page of data using a query like the following:  &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;table width="95%" border="0"&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td width="100%" bgcolor="#cccccc"&gt;&lt;code&gt;&lt;/code&gt;
            &lt;pre&gt;SELECT ...&lt;br /&gt;FROM&lt;br /&gt;   (SELECT ... &lt;br /&gt;         &lt;strong&gt;ROW_NUMBER() OVER(ORDER BY &lt;em&gt;ColumnName&lt;/em&gt;) as RowNum&lt;/strong&gt;&lt;br /&gt;    FROM Employees e&lt;br /&gt;   ) as &lt;em&gt;DerivedTableName&lt;/em&gt;&lt;br /&gt;WHERE &lt;strong&gt;RowNum BETWEEN @startRowIndex AND (@startRowIndex + @maximumRows) - 1&lt;/strong&gt; &lt;/pre&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Here &lt;code&gt;@startRowIndex&lt;/code&gt; is the index of the row to start from and &lt;code&gt;@maximumRows&lt;/code&gt; is the maximum number of records to show per page. This query returns the subset of records whose &lt;code&gt;ROW_NUMBER()&lt;/code&gt; is between the starting index and the starting index plus the page size.  &lt;/p&gt;
&lt;p&gt;To help concretize this concept, let's look at the following example. Imagine that we have an &lt;code&gt;Employees&lt;/code&gt; table with 5,000 records (business is good!). The following query:  &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;table width="95%" border="0"&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td width="100%" bgcolor="#cccccc"&gt;&lt;code&gt;&lt;/code&gt;
            &lt;pre&gt;SELECT RowNum, EmployeeID, LastName, FirstName&lt;br /&gt;FROM&lt;br /&gt;   (SELECT EmployeeID, LastName, FirstName &lt;br /&gt;       &lt;strong&gt;ROW_NUMBER() OVER(ORDER BY EmployeeID) as RowNum&lt;/strong&gt;&lt;br /&gt;    FROM Employees e&lt;br /&gt;   ) as EmployeeInfo&lt;br /&gt;&lt;/pre&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Would return results like:  &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;table cellspacing="1" cellpadding="4" border="1" align="center"&gt;
    &lt;tbody&gt;
        &lt;tr style="background-color: rgb(221, 221, 221);"&gt;
            &lt;th&gt;RowNum&lt;/th&gt;
            &lt;th&gt;EmployeeID&lt;/th&gt;
            &lt;th&gt;LastName&lt;/th&gt;
            &lt;th&gt;FirstName&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td align="right"&gt;1&lt;/td&gt;
            &lt;td align="right"&gt;1000&lt;/td&gt;
            &lt;td&gt;Smith&lt;/td&gt;
            &lt;td&gt;Frank&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td align="right"&gt;2&lt;/td&gt;
            &lt;td align="right"&gt;1001&lt;/td&gt;
            &lt;td&gt;Jackson&lt;/td&gt;
            &lt;td&gt;Lucy&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td align="right"&gt;3&lt;/td&gt;
            &lt;td align="right"&gt;1011&lt;/td&gt;
            &lt;td&gt;Lee&lt;/td&gt;
            &lt;td&gt;Sam&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td align="right"&gt;4&lt;/td&gt;
            &lt;td align="right"&gt;1012&lt;/td&gt;
            &lt;td&gt;Mitchell&lt;/td&gt;
            &lt;td&gt;Jisun&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td align="right"&gt;5&lt;/td&gt;
            &lt;td align="right"&gt;1013&lt;/td&gt;
            &lt;td&gt;Yates&lt;/td&gt;
            &lt;td&gt;Scott&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td align="right"&gt;6&lt;/td&gt;
            &lt;td align="right"&gt;1016&lt;/td&gt;
            &lt;td&gt;Props&lt;/td&gt;
            &lt;td&gt;Kathryn&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td align="middle" colspan="4"&gt;...&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td align="right"&gt;5000&lt;/td&gt;
            &lt;td align="right"&gt;6141&lt;/td&gt;
            &lt;td&gt;Jordan&lt;/td&gt;
            &lt;td&gt;DJ&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Notice that even though the &lt;code&gt;EmployeeID&lt;/code&gt; fields may have gaps and may not start at 1, the &lt;code&gt;ROW_NUMBER()&lt;/code&gt; value starts at 1 for the first record and steadily increases. Therefore, if we want to view 10 records per page, and we want to see the third page, we know that we want records 31-40, and can accomplish that in a simple &lt;code&gt;WHERE&lt;/code&gt; clause.  &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Configuring the ObjectDataSource for Custom Paging&lt;/strong&gt;&lt;br /&gt;
As aforementioned, the SqlDataSource isn't designed to provide custom sorting capabilities. The ObjectDataSource, on the other hand, was designed to support this scenario. The ObjectDataSource is a data source control that's designed to access data from an object. The object can retrieve its data however it likes, be it from a Web Service, a database, the file system, an XML file... whatever. The ObjectDataSource doesn't care, it simply acts as a proxy between the data Web control that wants to consume the data (such as a GridView control) and the underlying data that the object provides. (For more information on the ObjectDataSource see the &lt;a href="http://venjiang.sogot.com/ct.ashx?id=10c0c4a9-f83c-4a90-9069-b0325eae43da&amp;amp;url=http%3a%2f%2fmsdn2.microsoft.com%2fen-US%2flibrary%2f9a4kyhcx.aspx"&gt;ObjectDataSource Control Overview&lt;/a&gt;.)  &lt;/p&gt;
&lt;p&gt;When binding a data Web control to an ObjectDataSource the "Enable Paging" option is available. If you've not specifically set up the ObjectDataSource to support custom paging, the paging provided will be of the default paging flavor. To setup custom paging with the ObjectDataSource you need to be using an object that provides the following functionality: &lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;A method that takes in as its final two input parameters two integer values. The first integer value specifies the starting index from which to retrieve the data (it's zero-based), while the second integer value indicates the maximum number of records to retrieve per page. This method needs to return the precise subset of data being requested, namely the data starting at the specified index and not exceeding the total number of records indicated. &lt;/li&gt;
    &lt;li&gt;A method that returns an integer value specifying the &lt;em&gt;total&lt;/em&gt; number of records that are being paged through. (This information is used by the data Web control when rendering the paging controls, since it needs to know how many total pages of data there are when showing page numbers or when deciding whether to enable the Next link.) &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you are using an underlying object that provides these features, configuring the ObjectDataSource to support custom paging is a breeze. Just set the following ObjectDataSource properties: &lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Set &lt;code&gt;EnablePaging&lt;/code&gt; to True  &lt;/li&gt;
    &lt;li&gt;Set &lt;code&gt;SelectMethod&lt;/code&gt; to the method that accepts the starting index and maximum number of rows input parameters  &lt;/li&gt;
    &lt;li&gt;Set the &lt;code&gt;StartRowIndexParameterName to the name of the integer input parameter in your &lt;code&gt;SelectMethod&lt;/code&gt; that accepts the starting index; if you do not provide this value it defaults to &lt;code&gt;startRowIndex&lt;/code&gt;  &lt;/code&gt;&lt;/li&gt;
    &lt;li&gt;Set the &lt;code&gt;MaximumRowsParameterName to the name of the integer input parameter in your &lt;code&gt;SelectMethod&lt;/code&gt; that accepts the maximum number of rows to return; if you do not provide this value it defaults to &lt;code&gt;maximumRows&lt;/code&gt;  &lt;/code&gt;&lt;/li&gt;
    &lt;li&gt;Set &lt;code&gt;SelectCountMethod&lt;/code&gt; to the method that returns the total number of records being paged through &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That's it. Once you've done the above, the ObjectDataSource will be using the custom paging functionality. Of course, the hard part of this all is creating the underlying object that can intelligently grab the right subset of data. But once you have that object, configuring the ObjectDataSource to utilize custom paging is just a matter of setting a few properties. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Creating an Object That Supports Custom Paging&lt;/strong&gt;&lt;br /&gt;
In order to bind an ObjectDataSource to a GridView we need to first have an underlying object that the ObjectDataSource will use, and this object must have methods for accessing a particular subset of the data and returning the number of rows to be paged through. As discussed in &lt;a href="http://venjiang.sogot.com/ct.ashx?id=10c0c4a9-f83c-4a90-9069-b0325eae43da&amp;amp;url=http%3a%2f%2fjosephchancellor.wordpress.com%2f"&gt;Joseph Chancellor&lt;/a&gt;'s article, &lt;a href="http://venjiang.sogot.com/ct.ashx?id=10c0c4a9-f83c-4a90-9069-b0325eae43da&amp;amp;url=http%3a%2f%2faspnet.4guysfromrolla.com%2farticles%2f020806-1.aspx"&gt;Using Strongly-Typed Data Access in Visual Studio 2005 and ASP.NET 2.0&lt;/a&gt; and &lt;a href="http://venjiang.sogot.com/ct.ashx?id=10c0c4a9-f83c-4a90-9069-b0325eae43da&amp;amp;url=http%3a%2f%2fwww.softinsight.com%2fbnoyes%2f"&gt;Brian Noyes&lt;/a&gt;'s article &lt;a href="http://venjiang.sogot.com/ct.ashx?id=10c0c4a9-f83c-4a90-9069-b0325eae43da&amp;amp;url=http%3a%2f%2fwww.theserverside.net%2farticles%2fshowarticle.tss%3fid%3dDataSetDesigner"&gt;Build a Data Access Layer with the Visual Studio 2005 DataSet Designer&lt;/a&gt;, creating objects that can be bound to the ObjectDataSource is a breeze in Visual Studio 2005. The first step is to define the stored procedures (or SQL queries) that will be used to populate the strongly-typed DataSets returned by these object's methods. &lt;/p&gt;
&lt;p&gt;The download, available at the end of this article, has a sample database with 50,000 employee records (plus an easy way to add additional records in bulk). The database includes three stored procedures that are used by the two custom paging demos: &lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;code&gt;GetEmployeesSubset(@startRowIndex int, @maximumRows int)&lt;/code&gt; - returns at most &lt;code&gt;@maximumRows&lt;/code&gt; records from the &lt;code&gt;Employees&lt;/code&gt; table starting at &lt;code&gt;@startRowIndex&lt;/code&gt; when ordered by &lt;code&gt;EmployeeID&lt;/code&gt;.  &lt;/li&gt;
    &lt;li&gt;&lt;code&gt;GetEmployeesRowCount&lt;/code&gt; - returns the total number of records in the &lt;code&gt;Employees&lt;/code&gt; table.  &lt;/li&gt;
    &lt;li&gt;&lt;code&gt;GetEmployeesSubsetSorted(@sortExpression nvarchar(50), @startRowIndex int, @maximumRows int)&lt;/code&gt; - this sproc returns a page of data &lt;em&gt;sorted&lt;/em&gt; by a specified sort expression. This allows the a page of data ordered by, say, Salary, to be returned. (&lt;code&gt;GetEmployeesSubset&lt;/code&gt; returns records always ordered by &lt;code&gt;EmployeeID&lt;/code&gt;.) This flexibility is needed if you want to create a sortable GridView that employs custom paging. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;We won't be discussing implementing the sortable, custom pageable GridView in this article, although examples are included in this article's download; see &lt;a href="http://venjiang.sogot.com/ct.ashx?id=10c0c4a9-f83c-4a90-9069-b0325eae43da&amp;amp;url=http%3a%2f%2faspnet.4guysfromrolla.com%2farticles%2f032206-1.aspx"&gt;Sorting Custom Paged Results&lt;/a&gt; for a look at how to create a custom paging &lt;strong&gt;and&lt;/strong&gt; bi-directional sortable UI...&lt;/em&gt; &lt;/p&gt;
&lt;p&gt;Once these stored procedures are created, I created the underlying object by adding a Typed DataSet to my project (&lt;code&gt;Employees.xsd&lt;/code&gt;). I then added three methods, one against each of the stored procedures listed above. I ended up with an &lt;code&gt;EmployeesTableAdapter&lt;/code&gt; object with methods &lt;code&gt;GetEmployeesSubset(&lt;em&gt;startRowIndex&lt;/em&gt;, &lt;em&gt;maximumRows&lt;/em&gt;)&lt;/code&gt; and &lt;code&gt;GetEmployeesRowCount()&lt;/code&gt; that can then be plugged into the ObjectDataSource's properties. (For step-by-step instructions on creating the Typed DataSet, see &lt;a href="http://venjiang.sogot.com/ct.ashx?id=10c0c4a9-f83c-4a90-9069-b0325eae43da&amp;amp;url=http%3a%2f%2faspnet.4guysfromrolla.com%2farticles%2f020806-1.aspx"&gt;Using Strongly-Typed Data Access in Visual Studio 2005 and ASP.NET 2.0&lt;/a&gt; and &lt;a href="http://venjiang.sogot.com/ct.ashx?id=10c0c4a9-f83c-4a90-9069-b0325eae43da&amp;amp;url=http%3a%2f%2fweblogs.asp.net%2fscottgu%2f"&gt;Scott Guthrie&lt;/a&gt;'s blog entry &lt;a href="http://venjiang.sogot.com/ct.ashx?id=10c0c4a9-f83c-4a90-9069-b0325eae43da&amp;amp;url=http%3a%2f%2fweblogs.asp.net%2fscottgu%2farchive%2f2006%2f01%2f15%2f435498.aspx"&gt;Building a DAL using Strongly Typed TableAdapters and DataTables in VS 2005 and ASP.NET 2.0&lt;/a&gt;.)  &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Comparing the Performance of Default Paging and Custom Paging&lt;/strong&gt;&lt;br /&gt;
To compare the performance between default and custom paging against the database included in this article's download (which has a table with 50,000 records), I used both SQL Profile and ASP.NET tracing to ascertain relative performance differences. (These techniques were done very unscientifically on my computer, which had other processes running in the background and such. While the results can hardly be called conclusive, I think the performance differences between the two methods clearly highlights custom paging's advantages.) &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;table width="100%" border="0"&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;th style="color: white; background-color: navy;" colspan="2"&gt;SQL Profiler Results&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td width="50%" align="middle"&gt;
            &lt;table cellspacing="1" cellpadding="4" border="1"&gt;
                &lt;tbody&gt;
                    &lt;tr&gt;
                        &lt;th colspan="2"&gt;Default Paging&lt;/th&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td colspan="2"&gt;(Selecting &lt;em&gt;All&lt;/em&gt; Records from &lt;code&gt;Employees&lt;/code&gt;)&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td style="font-weight: bold; background-color: rgb(238, 238, 238); text-align: center;"&gt;Duration (sec)&lt;/td&gt;
                        &lt;td style="font-weight: bold; background-color: rgb(238, 238, 238); text-align: center;"&gt;Reads&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td align="right"&gt;1.455&lt;/td&gt;
                        &lt;td align="right"&gt;383&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td align="right"&gt;1.405&lt;/td&gt;
                        &lt;td align="right"&gt;383&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td align="right"&gt;1.434&lt;/td&gt;
                        &lt;td align="right"&gt;383&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td align="right"&gt;1.394&lt;/td&gt;
                        &lt;td align="right"&gt;383&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td align="right"&gt;1.365&lt;/td&gt;
                        &lt;td align="right"&gt;383&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td align="right" style="font-weight: bold;"&gt;Avg: 1.411&lt;/td&gt;
                        &lt;td align="right" style="font-weight: bold;"&gt;Avg: 383&lt;/td&gt;
                    &lt;/tr&gt;
                &lt;/tbody&gt;
            &lt;/table&gt;
            &lt;/td&gt;
            &lt;td width="50%" align="middle"&gt;
            &lt;table cellspacing="1" cellpadding="4" border="1"&gt;
                &lt;tbody&gt;
                    &lt;tr&gt;
                        &lt;th colspan="2"&gt;Custom Paging&lt;/th&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td colspan="2"&gt;(Selecting a Page of Records from &lt;code&gt;Employees&lt;/code&gt;)&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td style="font-weight: bold; background-color: rgb(238, 238, 238); text-align: center;"&gt;Duration (sec)&lt;/td&gt;
                        &lt;td style="font-weight: bold; background-color: rgb(238, 238, 238); text-align: center;"&gt;Reads&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td align="right"&gt;0.003&lt;/td&gt;
                        &lt;td align="right"&gt;29&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td align="right"&gt;0.000&lt;/td&gt;
                        &lt;td align="right"&gt;29&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td align="right"&gt;0.000&lt;/td&gt;
                        &lt;td align="right"&gt;29&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td align="right"&gt;0.003&lt;/td&gt;
                        &lt;td align="right"&gt;29&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td align="right"&gt;0.003&lt;/td&gt;
                        &lt;td align="right"&gt;29&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td align="right" style="font-weight: bold;"&gt;Avg: 0.002&lt;/td&gt;
                        &lt;td align="right" style="font-weight: bold;"&gt;Avg: 29&lt;/td&gt;
                    &lt;/tr&gt;
                &lt;/tbody&gt;
            &lt;/table&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt; &lt;/p&gt;
&lt;table width="100%" border="0"&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;th style="color: white; background-color: navy;" colspan="3"&gt;ASP.NET Trace Results&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td width="33%" align="middle"&gt;
            &lt;table cellspacing="1" cellpadding="4" border="1"&gt;
                &lt;tbody&gt;
                    &lt;tr&gt;
                        &lt;th&gt;Default Paging&lt;/th&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;(Selecting &lt;em&gt;All&lt;/em&gt; Records from &lt;code&gt;Employees&lt;/code&gt;)&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td style="font-weight: bold; background-color: rgb(238, 238, 238); text-align: center;"&gt;Page Load Duration (sec)&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td align="right"&gt;2.34136852588807&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td align="right"&gt;2.35772228034569&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td align="right"&gt;2.43368277253115&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td align="right"&gt;2.43237562315881&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td align="right"&gt;2.33167064529151&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td align="right" style="font-weight: bold;"&gt;Avg: 2.379363969&lt;/td&gt;
                    &lt;/tr&gt;
                &lt;/tbody&gt;
            &lt;/table&gt;
            &lt;/td&gt;
            &lt;td width="33%" align="middle"&gt;
            &lt;table cellspacing="1" cellpadding="4" border="1"&gt;
                &lt;tbody&gt;
                    &lt;tr&gt;
                        &lt;th&gt;Custom Paging&lt;/th&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;(Selecting a Page of Records from &lt;code&gt;Employees&lt;/code&gt;)&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td style="font-weight: bold; background-color: rgb(238, 238, 238); text-align: center;"&gt;Page Load Duration (sec)&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td align="right"&gt;0.0259611207569677&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td align="right"&gt;0.0280046765720224&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td align="right"&gt;0.0359054013848129&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td align="right"&gt;0.0295534767686955&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td align="right"&gt;0.0300096800012292&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td align="right" style="font-weight: bold;"&gt;Avg: 0.029886871&lt;/td&gt;
                    &lt;/tr&gt;
                &lt;/tbody&gt;
            &lt;/table&gt;
            &lt;/td&gt;
            &lt;td width="33%" align="middle"&gt;
            &lt;table cellspacing="1" cellpadding="4" border="1"&gt;
                &lt;tbody&gt;
                    &lt;tr&gt;
                        &lt;th&gt;Cached SqlDataSource&lt;/th&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;(Selecting &lt;em&gt;All&lt;/em&gt; Records, But Caching Them)&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td style="font-weight: bold; background-color: rgb(238, 238, 238); text-align: center;"&gt;Page Load Duration (sec)&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td align="right"&gt;2.39666633608461&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td align="right"&gt;0.0431529705591074&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td align="right"&gt;0.0443528437273452&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td align="right"&gt;0.0442313199023898&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td align="right"&gt;0.0491523364002967&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td align="right" style="font-weight: bold;"&gt;Avg: 0.515511161&lt;/td&gt;
                    &lt;/tr&gt;
                &lt;/tbody&gt;
            &lt;/table&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;As you can see, the custom paging is roughly two order of magnitudes faster than the default paging. At the database level, the &lt;code&gt;GetEmployeesSubset(@startRowIndex int, @maximumRows int)&lt;/code&gt; stored procedure is about 470 times faster than the simple &lt;code&gt;SELECT&lt;/code&gt; statement that returns &lt;em&gt;all&lt;/em&gt; records from the &lt;code&gt;Employees&lt;/code&gt; table. Custom paging is about 120 times faster than default paging at the ASP.NET level. The reduction is performance gain is probably due to expensive workloads common to both approaches, namely setting up the database connection and issuing the command. Regardless, two orders of magnitude is a very big difference in the world of performance. And this disparity would be more pronounced with larger data sets or a server that was experiencing any kind of load. &lt;/p&gt;
&lt;p&gt;The cached SqlDataSource has a high cost when the cache is empty, as it must go to the database and get &lt;em&gt;all&lt;/em&gt; of the records. The frequency that the cache needs to be reloaded depends upon free resources on the web server (if you have low resources available, the cached DataSet may get evicted) and your cache expiration policy. After the data has been cached, though, it greatly improves in performance and is comparable to the custom paging approach. The 0.516 second average time would be amortized to closer to 0.05 seconds as more requests were served with the cached data. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br /&gt;
As with the DataGrid in ASP.NET 1.x, the GridView in 2.0 offers two flavors of paging: default and custom. Default paging is easier to setup, but involves requerying the database when viewing each and every page of data. Custom paging, however, more intelligently just grabs those records needing to be displayed and therefore affords much higher degree of performance. SQL Server 2005 simplifies obtaining the precise subset of records for an arbitrary page due to its &lt;a href="http://venjiang.sogot.com/ct.ashx?id=10c0c4a9-f83c-4a90-9069-b0325eae43da&amp;amp;url=http%3a%2f%2fwww.4guysfromrolla.com%2fwebtech%2f010406-1.shtml"&gt;ability to rank results&lt;/a&gt;, which includes the &lt;code&gt;ROW_NUMBER()&lt;/code&gt; feature.  &lt;/p&gt;
&lt;p&gt;If you are building web applications that need to scale or either now or in the future will allow users to page through potentially large data sets, it behooves you to implement custom paging. &lt;/p&gt;
&lt;p&gt;Happy Programming!  &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
By &lt;a href="http://venjiang.sogot.com/ct.ashx?id=10c0c4a9-f83c-4a90-9069-b0325eae43da&amp;amp;url=http%3a%2f%2fwww.4guysfromrolla.com%2fScottMitchell.shtml"&gt;Scott Mitchell&lt;/a&gt;&lt;img src="http://blog.hidotnet.com/venjiang/aggbug/4.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>venjiang</dc:creator>
            <guid>http://blog.hidotnet.com/venjiang/archive/2006/10/11/4.aspx</guid>
            <pubDate>Wed, 11 Oct 2006 15:35:08 GMT</pubDate>
            <wfw:comment>http://blog.hidotnet.com/venjiang/comments/4.aspx</wfw:comment>
            <comments>http://blog.hidotnet.com/venjiang/archive/2006/10/11/4.aspx#feedback</comments>
            <slash:comments>501</slash:comments>
            <wfw:commentRss>http://blog.hidotnet.com/venjiang/comments/commentRss/4.aspx</wfw:commentRss>
            <trackback:ping>http://blog.hidotnet.com/venjiang/services/trackbacks/4.aspx</trackback:ping>
        </item>
        <item>
            <title>Paging through lots of data efficiently (and in an Ajax way) with ASP.NET 2.0</title>
            <link>http://blog.hidotnet.com/venjiang/archive/2006/10/11/3.aspx</link>
            <description>&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;a href="http://venjiang.sogot.com/ct.ashx?id=9282a22e-7611-4a88-ac4b-c09717afe7dc&amp;amp;url=http%3a%2f%2fdavidhayden.com%2fblog%2fdave%2f"&gt;&lt;font size="2"&gt;David Hayden&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; blogged about &lt;/font&gt;&lt;a href="http://venjiang.sogot.com/ct.ashx?id=9282a22e-7611-4a88-ac4b-c09717afe7dc&amp;amp;url=http%3a%2f%2fdavidhayden.com%2fblog%2fdave%2farchive%2f2005%2f12%2f30%2f2652.aspx"&gt;&lt;font size="2"&gt;a cool new ROW_NUMBER() function&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; that SQL 2005 provides that got me excited and inspired to write a little code last night.&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;You can download the sample app I built &lt;a href="http://venjiang.sogot.com/ct.ashx?id=9282a22e-7611-4a88-ac4b-c09717afe7dc&amp;amp;url=http%3a%2f%2fwww.scottgu.com%2fBlogPosts%2fAtlas2%2fpagingsample.zip"&gt;here&lt;/a&gt;.&lt;span style=""&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;strong style=""&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;Features of the Sample&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;This sample is a self-contained ASP.NET application that demonstrates a few things:&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;- How to implement a data-result search page built with ASP.NET 2.0 and Atlas that can present hundreds of thousands of row results using the ASP.NET 2.0 GridView control.&lt;span style=""&gt;  &lt;/span&gt;The results are formatted using a “paging” based UI model – where 15 results per page are displayed, and the user can skip from page to page to see their data.&lt;span style=""&gt;  &lt;/span&gt;For kicks I also added support for editing and deleting each individual row.&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;- How to optimize the number of rows returned by the SQL Server to the middle-tier web-server.&lt;span style=""&gt;  &lt;/span&gt;This sample demonstrates how a large query result (think 1000s, 10s of thousands or 100s of thousands of rows) can be paged efficiently so that only the 15 rows currently on display in a page are ever retrieved by the web-server from the SQL database (this is done using the ROW_NUMBER() function that David describes above, as well as the support for optimized paging provided by the GridView and ObjectDataSource controls).&lt;span style=""&gt;  &lt;/span&gt;This avoids your web-server and SQL server grinding to a halt when you execute large queries, and makes for much more scalable performance.&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;- How to easily implement Ajax UI support for paging/editing/deleting on top of hundreds of thousands of rows of data (so no full page refreshes – instead it only updates the portion of the page that changes).&lt;span style=""&gt;  &lt;/span&gt;This took me only 60 seconds to-do, and uses the same &amp;lt;atlas:updatepanel&amp;gt; control support I talked about in this earlier &lt;/font&gt;&lt;a href="http://venjiang.sogot.com/ct.ashx?id=9282a22e-7611-4a88-ac4b-c09717afe7dc&amp;amp;url=http%3a%2f%2fweblogs.asp.net%2fscottgu%2farchive%2f2005%2f12%2f26%2f433997.aspx"&gt;&lt;font size="2"&gt;blog post&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;.&lt;span style=""&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;- How to easily implement Ajax UI support for adding “auto-suggest” behavior to controls like text-boxes.&lt;span style=""&gt;  &lt;/span&gt;The December release of the Atlas Project provides a super-easy server control called the &amp;lt;atlas:autocompleteextender&amp;gt; control that you can point at a TextBox, and that will then call a web-service to provide a list of suggestions when a browser user starts typing in the text-box.&lt;span style=""&gt;  &lt;/span&gt;This sample demonstrates how to use this to auto-suggest items based on the contents in the database.&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;- How to implement a business class façade/wrapper around a data access layer.&lt;span style=""&gt;  &lt;/span&gt;This is in turn used by the new ASP.NET 2.0 ObjectDataSource control for databinding scenarios.&lt;span style=""&gt;  &lt;/span&gt;For this simple sample, I could have just used the data access layer built by using File-&amp;gt;Add New Item-&amp;gt;DataSet from the ObjectDataSource control directly (like I did with my earlier &lt;/font&gt;&lt;a href="http://venjiang.sogot.com/ct.ashx?id=9282a22e-7611-4a88-ac4b-c09717afe7dc&amp;amp;url=http%3a%2f%2fweblogs.asp.net%2fscottgu%2farchive%2f2005%2f12%2f26%2f433997.aspx"&gt;&lt;font size="2"&gt;To-do List sample&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;), and basically eliminate the need to write any code in the app.&lt;span style=""&gt;  &lt;/span&gt;But I wanted to use this sample to help demonstrate how to build a richer business library layer abstraction that was separate from my data access layer.&lt;span style=""&gt;  &lt;/span&gt;The business layer implementation in this sample is pretty trivial (and doesn’t really add much value), but it demonstrates a skeleton of how/where you could easily add business logic rules that were cleanly separated from your data layer.&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;strong style=""&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;How To Run and Use the Application&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;To setup the sample, follow the below steps:&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;1) Have VS 2005 or Visual Web Developer and SQL Express installed.&lt;span style=""&gt;  &lt;/span&gt;Visual Web Developer and SQL Express are both free downloads and provide everything you need to build, debug and run the application.&lt;span style=""&gt;  &lt;/span&gt;You can download them from &lt;/font&gt;&lt;a href="http://venjiang.sogot.com/ct.ashx?id=9282a22e-7611-4a88-ac4b-c09717afe7dc&amp;amp;url=http%3a%2f%2fwww.asp.net%2fdefault.aspx%3ftabindex%3d7%26tabid%3d46"&gt;&lt;font size="2"&gt;here&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;2) Download this &lt;a href="http://venjiang.sogot.com/ct.ashx?id=9282a22e-7611-4a88-ac4b-c09717afe7dc&amp;amp;url=http%3a%2f%2fwww.scottgu.com%2fBlogPosts%2fAtlas2%2fpagingsample.zip"&gt;.zip file&lt;/a&gt; containing the sample.&lt;span style=""&gt;  &lt;/span&gt;Expand it into any directory you want.&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;3) Using Visual Web Developer or VS 2005, choose File-&amp;gt;Open Web-site and point to the root directory of the sample sub-directory (the one with the files in it).&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;4) Select the “PagedData.aspx” file and hit run.&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;This will bring up a page that looks like this:&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;&lt;img src="http://www.scottgu.com/BlogPosts/Atlas2/step1.png" alt="" /&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;This allows you to query for lists by categories in your database.&lt;span style=""&gt;  &lt;/span&gt;The default database in the sample doesn’t have any list items, so first we’ll want to create some.&lt;span style=""&gt;  &lt;/span&gt;To-do this click the “Bulk Add” link.&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;Create a category called “test” and add 100 items to it.&lt;span style=""&gt;  &lt;/span&gt;This will create a bunch of sample data in the database that will help simulate paging.&lt;span style=""&gt;  &lt;/span&gt;Then repeat this with a new category called “test2” and add 10,000 items to it.&lt;span style=""&gt;  &lt;/span&gt;Then repeat this with a new category called “test3” and add 100,000 items to it. &lt;span style=""&gt;  &lt;/span&gt;Note that this last category will probably take a few minutes to create (since the logic in my app is simple and just adds them one row at a time).&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;&lt;img src="http://www.scottgu.com/BlogPosts/Atlas2/step3.png" alt="" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;Then click on the “Return to Paged Data Page” link and start typing a search string in the textbox.&lt;span style=""&gt;  &lt;/span&gt;Pause slightly after you type “tes” – and then notice how the auto-suggest box will list the three new categories you added:&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;&lt;img src="http://www.scottgu.com/BlogPosts/Atlas2/step4.png" alt="" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;These are being populated using the &amp;lt;atlas:autocompleteextender&amp;gt; server control (which is hitting a web-service on the server to lookup the available categories – and so will return the three new ones we just created).&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;Search using “test3” (the one with 100,000 items), and you’ll see this paged view of 100,000 items in the GridView:&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;&lt;img src="http://www.scottgu.com/BlogPosts/Atlas2/step5.png" alt="" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;Each page of the screen contains 15 items from the database.&lt;span style=""&gt;  &lt;/span&gt;You can switch around to see the different pages.&lt;span style=""&gt;  &lt;/span&gt;Click the “…” link to go to pages 11-20.&lt;span style=""&gt;  &lt;/span&gt;Click “Last” to jump to the final page of data:&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;&lt;img src="http://www.scottgu.com/BlogPosts/Atlas2/step6.png" alt="" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;Note that as you choose the different pages, the only thing that gets updated is the grid of data – the overall page &lt;u&gt;does not&lt;/u&gt; refresh.&lt;span style=""&gt;  &lt;/span&gt;This is because the GridView control is wrapped using the &amp;lt;atlas:updatepanel&amp;gt; control which allows incremental &lt;st1:city w:st="on"&gt;&lt;st1:place w:st="on"&gt;Ajax&lt;/st1:place&gt;&lt;/st1:city&gt; refreshes of the page (no code required to accomplish this &amp;lt;g&amp;gt;).&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;Page back a few screens, and then click “edit” on one of the rows.&lt;span style=""&gt;  &lt;/span&gt;Note that you can now edit and update its items.&lt;span style=""&gt;  &lt;/span&gt;You can also click “delete” on a row to remove one.&lt;span style=""&gt;  &lt;/span&gt;Both operations occur in an &lt;st1:city w:st="on"&gt;&lt;st1:place w:st="on"&gt;Ajax&lt;/st1:place&gt;&lt;/st1:city&gt; way:&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;&lt;img src="http://www.scottgu.com/BlogPosts/Atlas2/step7.png" alt="" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;strong style=""&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;How is this Application Built&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;Here is what the solution directory looks like in Visual Web Developer:&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;&lt;img src="http://www.scottgu.com/BlogPosts/Atlas2/step8.png" alt="" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;It contains two pages – PagedData.aspx and AddData.aspx – that are each based on the Site.master master-page.&lt;span style=""&gt;  &lt;/span&gt;It also contains one web-service – categories.asmx – which is used by the &amp;lt;atlas:autocompleteextender&amp;gt; control.&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;The database is implemented in PagingSample.mdf and contains 1 simple table called “Lists” (note: you can create new SQL Express databases by select File-&amp;gt;Add New Item-&amp;gt;Database File):&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;&lt;img src="http://www.scottgu.com/BlogPosts/Atlas2/step9.png" alt="" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;ListId is the primary key, and the Category column has been marked to be indexed (note: this is important since we’ll be creating 100,000+ rows).&lt;span style=""&gt;  &lt;/span&gt;To set indexes, right click on a column in the table designer and choose “Indexs/Keys” and make sure that “Categories” is being indexed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;The database has one stored procedure called “GetPagedLists” that was created using the ROW_NUMBER() approach described in &lt;/font&gt;&lt;a href="http://venjiang.sogot.com/ct.ashx?id=9282a22e-7611-4a88-ac4b-c09717afe7dc&amp;amp;url=http%3a%2f%2fdavidhayden.com%2fblog%2fdave%2farchive%2f2005%2f12%2f30%2f2652.aspx"&gt;&lt;font size="2"&gt;David’s blog&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;&lt;img src="http://www.scottgu.com/BlogPosts/Atlas2/step10.png" alt="" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;Note: you can double-click on the sproc name in the solution explorer to open and edit it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;The data access layer was implemented using a DataSet component (choose File-&amp;gt;Add New Item-&amp;gt;DataSet to create one). It is defined declaratively within the “MyDataLayer.xsd” file and contains two table-adapters:&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;&lt;img src="http://www.scottgu.com/BlogPosts/Atlas2/step11.png" alt="" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;GetPagedListData goes against the SPOC above, but all other methods are normal SQL queries (note: the GetListCountByCategory method is defined as: &lt;em style=""&gt;SELECT COUNT(*) FROM Lists where category=@category&lt;/em&gt; and returns a scalar integer value).&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;I could have just used the DAL layer directly from the UI tier, but instead chose to wrap the DAL with a business layer façade that looks like this:&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;&lt;img src="http://www.scottgu.com/BlogPosts/Atlas2/step12.png" alt="" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;The two significant methods for our paging sample are “GetListCountByCategory” and “GetListsByCategory”.&lt;span style=""&gt;  &lt;/span&gt;Here are the simple implementations of them in our business façade layer (note: right now they just thinly wrap the data access layer and expose the row data as custom “ListItem” types – so they don’t provide much value over calling the DAL directly, but do demonstrate how you could add your own custom logic around it):&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;&lt;img src="http://www.scottgu.com/BlogPosts/Atlas2/step13.png" alt="" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;Databinding a paged GridView control to this middle-tier object is easy (and automated if you are using the WYSIWYG designer in Visual Web Developer).&lt;span style=""&gt;  &lt;/span&gt;Just set the “AllowPaging=true” property on the GridView and set the PageSize value you want (for this sample I am using 15 rows per page).&lt;span style=""&gt;  &lt;/span&gt;Then point the GridView at an ObjectDataSource control, which is configured to use the ListManager business façade class.&lt;span style=""&gt;  &lt;/span&gt;It has the “AllowPaging” attribute set to true, and has the “SelectMethod” and “SelectCount” properties pointing to the “GetLisByCategory” and “GetListCountByCategory” methods above.&lt;span style=""&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;&lt;img src="http://www.scottgu.com/BlogPosts/Atlas2/step14.png" alt="" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;Now, when you run the application, the GridView binds against the ObjectDataSource which will invoke the “GetListCountByCategory” method on our “ListManager” business façade class to calculate the total number of rows to page, and then invoke the “GetListByCategory” method passing the appropriate “category” parameter along with the “startRowIndex” and “maximumRows” parameter values that correspond to the page index that the GridView is currently on.&lt;span style=""&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;The beauty is that because we only retrieve and return the 15 rows of data we actually need from the database as part of this operation, the result is fast and scalable.&lt;span style=""&gt;  &lt;/span&gt;As a browser user pages back and forth on the data within the GridView across the 100,000 rows of data, all UI paging logic and update/edit semantics are handled for us.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;/span&gt; &lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;The last little implementation note to call out is the use of the &amp;lt;atlas:AutoCompleteExtender&amp;gt; control to auto-suggest items within the Category TextBox.  This is a new control provided by the Atlas December drop, and is simple to implement.  Basically, you just add the control to your page and point at the TextBox you want to complete, along with a web-service URL and method to call when the browser user types three letters in the TextBox -- these are then passed to the web-service, which can provide a list of suggestions back:&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;/span&gt; &lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;&lt;img src="http://www.scottgu.com/BlogPosts/Atlas2/step15.png" alt="" /&gt; &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;/span&gt; &lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;The implementation of the web-service method then looks like this within this sample:&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;/span&gt; &lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;&lt;img src="http://www.scottgu.com/BlogPosts/Atlas2/step16.png" alt="" /&gt; &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;Hope this helps and proves to be a useful sample.&lt;span style=""&gt;  &lt;/span&gt;Thanks again to David for the &lt;/font&gt;&lt;a href="http://venjiang.sogot.com/ct.ashx?id=9282a22e-7611-4a88-ac4b-c09717afe7dc&amp;amp;url=http%3a%2f%2fdavidhayden.com%2fblog%2fdave%2farchive%2f2005%2f12%2f30%2f2652.aspx"&gt;&lt;font size="2"&gt;blog post&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; on the new ROW_NUMBER() function in SQL 2005 that makes this much easier to implement.&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;Hope this helps – and happy new year!&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;Scott&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 0pt;" class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;P.S. Note that with SQL 2000 you can use the same approach as above, although the SPROC ends up being slightly more complicated.&lt;/font&gt;&lt;/span&gt;&lt;img src="http://blog.hidotnet.com/venjiang/aggbug/3.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>venjiang</dc:creator>
            <guid>http://blog.hidotnet.com/venjiang/archive/2006/10/11/3.aspx</guid>
            <pubDate>Wed, 11 Oct 2006 15:34:05 GMT</pubDate>
            <wfw:comment>http://blog.hidotnet.com/venjiang/comments/3.aspx</wfw:comment>
            <comments>http://blog.hidotnet.com/venjiang/archive/2006/10/11/3.aspx#feedback</comments>
            <slash:comments>611</slash:comments>
            <wfw:commentRss>http://blog.hidotnet.com/venjiang/comments/commentRss/3.aspx</wfw:commentRss>
            <trackback:ping>http://blog.hidotnet.com/venjiang/services/trackbacks/3.aspx</trackback:ping>
        </item>
    </channel>
</rss>