﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><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/"><channel><title>博客园-小朱</title><link>http://www.cnblogs.com/zsy/</link><description>要干就要用心...</description><language>zh-cn</language><lastBuildDate>Wed, 19 Nov 2008 08:52:11 GMT</lastBuildDate><pubDate>Wed, 19 Nov 2008 08:52:11 GMT</pubDate><ttl>60</ttl><item><title>给CheckBoxList和RadioButtonList添加滚动条</title><link>http://www.cnblogs.com/zsy/archive/2008/04/18/1160137.html</link><dc:creator>小朱</dc:creator><author>小朱</author><pubDate>Fri, 18 Apr 2008 08:40:00 GMT</pubDate><guid>http://www.cnblogs.com/zsy/archive/2008/04/18/1160137.html</guid><wfw:comment>http://www.cnblogs.com/zsy/comments/1160137.html</wfw:comment><comments>http://www.cnblogs.com/zsy/archive/2008/04/18/1160137.html#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://www.cnblogs.com/zsy/comments/commentRss/1160137.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/zsy/services/trackbacks/1160137.html</trackback:ping><description><![CDATA[<p>如何<font face="Verdana"><font face="Verdana">给CheckBoxList和RadioButtonList添加滚动条？？<br />
继承基类CheckBoxList和RadioButtonList，添加滚动属性，重写<font face="Verdana">Render</font>方法即可。<br />
属性列表：<br />
</p>
<p><font face="Verdana">#region 滚动控制<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private bool _ShowScrollBar = false;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// &lt;summary&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// 显示滚动条<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// &lt;/summary&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.ComponentModel.Description("是否显示显示滚动条")<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , System.ComponentModel.DefaultValue(false)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , System.ComponentModel.Category("滚动条设置")<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , System.ComponentModel.Bindable(System.ComponentModel.BindableSupport.Yes)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public bool ShowScrollBar<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; get { return _ShowScrollBar; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set { _ShowScrollBar = value; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private Overflow _OverflowY = Overflow.auto;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// &lt;summary&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// 竖直滚动条<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// &lt;/summary&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.ComponentModel.Description("竖直滚动条")<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , System.ComponentModel.DefaultValue(Overflow.auto)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , System.ComponentModel.Category("滚动条设置")<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , System.ComponentModel.Bindable(System.ComponentModel.BindableSupport.Yes)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public Overflow OverflowY<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; get { return _OverflowY; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set { _OverflowY = value; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private Overflow _OverflowX = Overflow.auto;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// &lt;summary&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// 水平滚动条<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// &lt;/summary&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.ComponentModel.Description("水平滚动条")<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , System.ComponentModel.DefaultValue(Overflow.auto)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , System.ComponentModel.Category("滚动条设置")<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , System.ComponentModel.Bindable(System.ComponentModel.BindableSupport.Yes)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public Overflow OverflowX<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; get { return _OverflowX; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set { _OverflowX = value; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private Unit _ScrollHeight = Unit.Parse("0px");<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// &lt;summary&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// 滚动高度<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// &lt;/summary&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.ComponentModel.Description("滚动高度")<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , System.ComponentModel.Category("滚动条设置")<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , DefaultValue("0px")<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , System.ComponentModel.Bindable(System.ComponentModel.BindableSupport.Yes)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public Unit ScrollHeight<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; get { return _ScrollHeight; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set { _ScrollHeight = value; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private Unit _ScrollWidth = Unit.Parse("0px");<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// &lt;summary&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// 滚动宽度<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// &lt;/summary&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.ComponentModel.Description("滚动宽度")<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , System.ComponentModel.Category("滚动条设置")<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , DefaultValue("0px")<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , System.ComponentModel.Bindable(System.ComponentModel.BindableSupport.Yes)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public Unit ScrollWidth<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; get { return _ScrollWidth; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set { _ScrollWidth = value; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private string _ScrollCssClass = "";<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// &lt;summary&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// 滚动样式设置<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// &lt;/summary&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.ComponentModel.Description("滚动样式设置")<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , System.ComponentModel.Category("滚动条设置")<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , System.ComponentModel.DefaultValue("")<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , System.ComponentModel.Bindable(System.ComponentModel.BindableSupport.Yes)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public string ScrollCssClass<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; get { return _ScrollCssClass; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set { _ScrollCssClass = value; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</font></p>
<p><font face="Verdana">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #region 书写标签<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void WriteBeginSpan(HtmlTextWriter writer)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (this._ShowScrollBar)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; StringBuilder strSpan = new StringBuilder();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strSpan.Append("&lt;span ");<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strSpan.Append(string.Format("style='overflow-y:{0};overflow-x:{1};",<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Enum.GetName(typeof(Overflow), this._OverflowY),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Enum.GetName(typeof(Overflow), this._OverflowX)));<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (this._ScrollHeight.ToString() != "0px")<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strSpan.Append(string.Format("height:{0};", this._ScrollHeight));<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (this._ScrollWidth.ToString() != "0px")<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strSpan.Append(string.Format("width:{0};", this._ScrollWidth));<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strSpan.Append("';");<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!string.IsNullOrEmpty(_ScrollCssClass))<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strSpan.Append(string.Format(" class='{0}'", _ScrollCssClass));<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strSpan.Append("&gt;");<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; writer.Write(strSpan.ToString());<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void WriteEndSpan(HtmlTextWriter writer)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (this._ShowScrollBar)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; writer.Write("&lt;/span&gt;");<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion<br />
重写Render方法：<br />
<font face="Verdana">protected override void Render(HtmlTextWriter writer)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.WriteBeginSpan(writer);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; base.Render(writer);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.WriteEndSpan(writer);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</font><br />
就这样就可以了。<br />
还要定义一个枚举：<br />
<font face="Verdana">public enum Overflow<br />
&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; auto = 0,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hidden = 1,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; scroll = 2,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; visible = 3,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inherit = 4<br />
&nbsp;&nbsp;&nbsp; }</font></font></p>
</font></font>
  <img src ="http://www.cnblogs.com/zsy/aggbug/1160137.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43607/" target="_blank">[新闻]后“开放”平台时代</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>ajaxPro与ComponentArt控件发布问题</title><link>http://www.cnblogs.com/zsy/archive/2007/10/08/916537.html</link><dc:creator>小朱</dc:creator><author>小朱</author><pubDate>Mon, 08 Oct 2007 00:42:00 GMT</pubDate><guid>http://www.cnblogs.com/zsy/archive/2007/10/08/916537.html</guid><wfw:comment>http://www.cnblogs.com/zsy/comments/916537.html</wfw:comment><comments>http://www.cnblogs.com/zsy/archive/2007/10/08/916537.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/zsy/comments/commentRss/916537.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/zsy/services/trackbacks/916537.html</trackback:ping><description><![CDATA[<style>
.GridView
{
background-color:White;
border-color:#888888;
border-width:1px;
border-style:solid;
width:100%;
border-collapse:collapse;
}
</style>
&nbsp;&nbsp;&nbsp;&nbsp;10月3号把网站发布上去，本地调试通过了。一到服务器就出现问题了，与AjaxPro有关的都提示&#8220;NetRoute&#8221;未定义；ComponentArt控件不显示，查看页面的源文件，与本地的相同。问题究竟出现在哪里？？<br />
&nbsp;&nbsp;&nbsp;&nbsp;到百度与Google上搜索一下，只找到了AjaxPro的解决办法，要设置ISAPI扩展，设置方法<br />
<table class="GridView" width="100%" border="1">
    <tbody>
        <tr>
            <th>名称</th>
            <th>内容</th>
        </tr>
        <tr>
            <td>可执行文件</td>
            <td>c:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll</td>
        </tr>
        <tr>
            <td>扩展名</td>
            <td>.ashx</td>
        </tr>
        <tr>
            <td>动作</td>
            <td>.限制为GHT,HEAD,POST,DEBUG</td>
        </tr>
        <tr>
            <td>选项</td>
            <td>去掉&#8220;确认文件是否存在&#8221;这个选项</td>
        </tr>
    </tbody>
</table>
&nbsp;&nbsp;&nbsp;&nbsp;ComponentArt控件是否也是类似的问题，经研究配置以下ISAPI扩展即可：<br />
<table class="GridView" width="100%" border="1">
    <tbody>
        <tr>
            <th>名称</th>
            <th>内容</th>
        </tr>
        <tr>
            <td>可执行文件</td>
            <td>c:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll</td>
        </tr>
        <tr>
            <td>扩展名</td>
            <td>.<font face="Verdana">axd</font></td>
        </tr>
        <tr>
            <td>动作</td>
            <td>.限制为GHT,HEAD,POST,DEBUG</td>
        </tr>
        <tr>
            <td>选项</td>
            <td>去掉&#8220;确认文件是否存在&#8221;这个选项</td>
        </tr>
    </tbody>
</table> <img src ="http://www.cnblogs.com/zsy/aggbug/916537.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43606/" target="_blank">[新闻]李彦宏首次表态竞价排名问题:有错能改善莫大焉</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>数据库截取一定长度的字符串</title><link>http://www.cnblogs.com/zsy/archive/2006/07/05/443034.html</link><dc:creator>小朱</dc:creator><author>小朱</author><pubDate>Wed, 05 Jul 2006 01:50:00 GMT</pubDate><guid>http://www.cnblogs.com/zsy/archive/2006/07/05/443034.html</guid><wfw:comment>http://www.cnblogs.com/zsy/comments/443034.html</wfw:comment><comments>http://www.cnblogs.com/zsy/archive/2006/07/05/443034.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnblogs.com/zsy/comments/commentRss/443034.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/zsy/services/trackbacks/443034.html</trackback:ping><description><![CDATA[数据库截取一定长度的字符串：<br>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top><span style="COLOR: #000000"><br><img id=Codehighlighter1_1_129_Open_Image onclick="this.style.display='none'; Codehighlighter1_1_129_Open_Text.style.display='none'; Codehighlighter1_1_129_Closed_Image.style.display='inline'; Codehighlighter1_1_129_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_1_129_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1_129_Closed_Text.style.display='none'; Codehighlighter1_1_129_Open_Image.style.display='inline'; Codehighlighter1_1_129_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_1_129_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</span><span id=Codehighlighter1_1_129_Open_Text><span style="COLOR: #008080">/*</span><span style="COLOR: #008080">******************************************<br><img src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;作者：小朱<br><img src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;功能：获取一定长度的字符串<br><img src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;日期：2004年11月01日<br><img src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>******************************************</span><span style="COLOR: #008080">*/</span></span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">CREATE</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">FUNCTION</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #ff0000">[</span><span style="COLOR: #ff0000">dbo</span><span style="COLOR: #ff0000">]</span><span style="COLOR: #000000">.</span><span style="COLOR: #ff0000">[</span><span style="COLOR: #ff0000">uf_GetString</span><span style="COLOR: #ff0000">]</span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;(<br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">@str</span><span style="COLOR: #000000">&nbsp;</span><span style="FONT-WEIGHT: bold; COLOR: #000000">VarChar</span><span style="COLOR: #000000">(</span><span style="FONT-WEIGHT: bold; COLOR: #800000">2000</span><span style="COLOR: #000000">)&nbsp;</span><span style="COLOR: #808080">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #ff0000">''</span><span style="COLOR: #000000">,&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">--</span><span style="COLOR: #008080">要截取的字符串</span><span style="COLOR: #008080"><br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">@getLen</span><span style="COLOR: #000000">&nbsp;</span><span style="FONT-WEIGHT: bold; COLOR: #000000">Int</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #808080">=</span><span style="COLOR: #000000">&nbsp;</span><span style="FONT-WEIGHT: bold; COLOR: #800000">0</span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">--</span><span style="COLOR: #008080">要截取的长度，按中文的汉字计算</span><span style="COLOR: #008080"><br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;)&nbsp;&nbsp;<br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">RETURNS</span><span style="COLOR: #000000">&nbsp;</span><span style="FONT-WEIGHT: bold; COLOR: #000000">VarChar</span><span style="COLOR: #000000">(</span><span style="FONT-WEIGHT: bold; COLOR: #800000">2000</span><span style="COLOR: #000000">)&nbsp;</span><span style="COLOR: #0000ff">AS</span><span style="COLOR: #000000">&nbsp;&nbsp;<br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">BEGIN</span><span style="COLOR: #000000">&nbsp;<br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">Declare</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008000">@lastStr</span><span style="COLOR: #000000">&nbsp;</span><span style="FONT-WEIGHT: bold; COLOR: #000000">VarChar</span><span style="COLOR: #000000">(</span><span style="FONT-WEIGHT: bold; COLOR: #800000">2000</span><span style="COLOR: #000000">)<br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">Declare</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008000">@tempStr</span><span style="COLOR: #000000">&nbsp;</span><span style="FONT-WEIGHT: bold; COLOR: #000000">VarChar</span><span style="COLOR: #000000">(</span><span style="FONT-WEIGHT: bold; COLOR: #800000">2000</span><span style="COLOR: #000000">)<br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">Declare</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008000">@str1</span><span style="COLOR: #000000">&nbsp;</span><span style="FONT-WEIGHT: bold; COLOR: #000000">VarChar</span><span style="COLOR: #000000">(</span><span style="FONT-WEIGHT: bold; COLOR: #800000">2</span><span style="COLOR: #000000">)<br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">Declare</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008000">@pos</span><span style="COLOR: #000000">&nbsp;</span><span style="FONT-WEIGHT: bold; COLOR: #000000">Int</span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">Declare</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008000">@ChineseCount</span><span style="COLOR: #000000">&nbsp;</span><span style="FONT-WEIGHT: bold; COLOR: #000000">Int</span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">Declare</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008000">@EnglishCount</span><span style="COLOR: #000000">&nbsp;</span><span style="FONT-WEIGHT: bold; COLOR: #000000">Int</span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">Select</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008000">@ChineseCount</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #808080">=</span><span style="COLOR: #000000">&nbsp;</span><span style="FONT-WEIGHT: bold; COLOR: #800000">0</span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">Select</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008000">@EnglishCount</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #808080">=</span><span style="COLOR: #000000">&nbsp;</span><span style="FONT-WEIGHT: bold; COLOR: #800000">0</span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">Select</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008000">@pos</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #808080">=</span><span style="COLOR: #000000">&nbsp;</span><span style="FONT-WEIGHT: bold; COLOR: #800000">1</span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">Select</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008000">@tempStr</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #808080">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #ff00ff">LTrim</span><span style="COLOR: #000000">(</span><span style="COLOR: #ff00ff">RTrim</span><span style="COLOR: #000000">(</span><span style="COLOR: #008000">@str</span><span style="COLOR: #000000">))<br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">While</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008000">@EnglishCount</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #808080">/</span><span style="COLOR: #000000">&nbsp;</span><span style="FONT-WEIGHT: bold; COLOR: #800000">2</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #808080">+</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008000">@ChineseCount</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #808080">&lt;</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008000">@getLen</span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">Begin</span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">If</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #ff00ff">Len</span><span style="COLOR: #000000">(</span><span style="COLOR: #008000">@tempStr</span><span style="COLOR: #000000">)&nbsp;</span><span style="COLOR: #808080">&lt;</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008000">@getLen</span><span style="COLOR: #000000">&nbsp;&nbsp;</span><span style="COLOR: #808080">OR</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008000">@pos</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #808080">+</span><span style="COLOR: #000000">&nbsp;</span><span style="FONT-WEIGHT: bold; COLOR: #800000">1</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #808080">&gt;</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #ff00ff">Len</span><span style="COLOR: #000000">(</span><span style="COLOR: #008000">@tempStr</span><span style="COLOR: #000000">)&nbsp;<br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">Begin</span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">Select</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008000">@lastStr</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #808080">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008000">@tempStr</span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">Break</span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">End</span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">Else</span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">Begin</span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">Select</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008000">@str1</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #808080">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #ff00ff">SubString</span><span style="COLOR: #000000">(</span><span style="COLOR: #008000">@tempStr</span><span style="COLOR: #000000">,</span><span style="COLOR: #008000">@pos</span><span style="COLOR: #000000">,</span><span style="FONT-WEIGHT: bold; COLOR: #800000">1</span><span style="COLOR: #000000">)<br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">If</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #ff00ff">DataLength</span><span style="COLOR: #000000">(</span><span style="COLOR: #008000">@str1</span><span style="COLOR: #000000">)&nbsp;</span><span style="COLOR: #808080">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #ff00ff">Len</span><span style="COLOR: #000000">(</span><span style="COLOR: #008000">@str1</span><span style="COLOR: #000000">)<br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">Select</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008000">@EnglishCount</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #808080">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008000">@EnglishCount</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #808080">+</span><span style="COLOR: #000000">&nbsp;</span><span style="FONT-WEIGHT: bold; COLOR: #800000">1</span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">Else</span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">Select</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008000">@ChineseCount</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #808080">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008000">@ChineseCount</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #808080">+</span><span style="COLOR: #000000">&nbsp;</span><span style="FONT-WEIGHT: bold; COLOR: #800000">1</span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">If</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008000">@EnglishCount</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #808080">/</span><span style="COLOR: #000000">&nbsp;</span><span style="FONT-WEIGHT: bold; COLOR: #800000">2</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #808080">+</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008000">@ChineseCount</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #808080">&gt;=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008000">@getLen</span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">Begin</span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">If</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008000">@EnglishCount</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #808080">%</span><span style="COLOR: #000000">&nbsp;</span><span style="FONT-WEIGHT: bold; COLOR: #800000">2</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #808080">&lt;&gt;</span><span style="COLOR: #000000">&nbsp;</span><span style="FONT-WEIGHT: bold; COLOR: #800000">0</span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">Select</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008000">@lastStr</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #808080">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #ff00ff">SubString</span><span style="COLOR: #000000">(</span><span style="COLOR: #008000">@tempStr</span><span style="COLOR: #000000">,</span><span style="FONT-WEIGHT: bold; COLOR: #800000">1</span><span style="COLOR: #000000">,</span><span style="COLOR: #008000">@pos</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #808080">-</span><span style="FONT-WEIGHT: bold; COLOR: #800000">1</span><span style="COLOR: #000000">)&nbsp;</span><span style="COLOR: #808080">+</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #ff0000">'</span><span style="COLOR: #ff0000"><img src="http://www.cnblogs.com/Images/dot.gif"></span><span style="COLOR: #ff0000">'</span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">Else</span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">Select</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008000">@lastStr</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #808080">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #ff00ff">SubString</span><span style="COLOR: #000000">(</span><span style="COLOR: #008000">@tempStr</span><span style="COLOR: #000000">,</span><span style="FONT-WEIGHT: bold; COLOR: #800000">1</span><span style="COLOR: #000000">,</span><span style="COLOR: #008000">@pos</span><span style="COLOR: #000000">)&nbsp;</span><span style="COLOR: #808080">+</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #ff0000">'</span><span style="COLOR: #ff0000"><img src="http://www.cnblogs.com/Images/dot.gif"></span><span style="COLOR: #ff0000">'</span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">Break</span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">End</span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">Select</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008000">@pos</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #808080">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008000">@pos</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #808080">+</span><span style="COLOR: #000000">&nbsp;</span><span style="FONT-WEIGHT: bold; COLOR: #800000">1</span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">End</span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">End</span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">Return</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008000">@lastStr</span><span style="COLOR: #000000">&nbsp;<br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">END</span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></span></div>
<img src ="http://www.cnblogs.com/zsy/aggbug/443034.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43605/" target="_blank">[新闻]杨致远发表博客解释辞职原因</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>数据库null值小议</title><link>http://www.cnblogs.com/zsy/archive/2006/07/05/443018.html</link><dc:creator>小朱</dc:creator><author>小朱</author><pubDate>Wed, 05 Jul 2006 01:38:00 GMT</pubDate><guid>http://www.cnblogs.com/zsy/archive/2006/07/05/443018.html</guid><wfw:comment>http://www.cnblogs.com/zsy/comments/443018.html</wfw:comment><comments>http://www.cnblogs.com/zsy/archive/2006/07/05/443018.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/zsy/comments/commentRss/443018.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/zsy/services/trackbacks/443018.html</trackback:ping><description><![CDATA[<p>在数据库的查询过程中，遇到以下问题：<br>当select * from tKeyword where typeId&nbsp;= case when @typeId &lt; 0 then null else @typeId end&nbsp;order by orderNo desc<br>这句话是正确的，但是当@typeId &lt; 0不出结果，而数据库中有满足条件typeId=null的数据。<br>后来进行了以下处理：<br>if @typeId &lt; 0 then<br>&nbsp;&nbsp;&nbsp; select * from tKeyword where typeId&nbsp;is null order by orderNo desc<br>else<br>&nbsp;&nbsp;&nbsp; select * from tKeyword where typeId&nbsp;= @typeId&nbsp;order by orderNo desc<br>问题得到解决了。进一步简化问题如下：<br>select * from tKeyword where isnull(typeId,@typeId)=@typeId end&nbsp;order by orderNo desc<br>显示这是一种更为简化的处理方法。<br><br>在数据操作时，一定要注意字段的null的处理方法。<br>好了，以后有机会在写了。<br><br></p>
<img src ="http://www.cnblogs.com/zsy/aggbug/443018.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43605/" target="_blank">[新闻]杨致远发表博客解释辞职原因</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>获取最大序号</title><link>http://www.cnblogs.com/zsy/archive/2006/01/10/314627.html</link><dc:creator>小朱</dc:creator><author>小朱</author><pubDate>Tue, 10 Jan 2006 07:23:00 GMT</pubDate><guid>http://www.cnblogs.com/zsy/archive/2006/01/10/314627.html</guid><wfw:comment>http://www.cnblogs.com/zsy/comments/314627.html</wfw:comment><comments>http://www.cnblogs.com/zsy/archive/2006/01/10/314627.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cnblogs.com/zsy/comments/commentRss/314627.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/zsy/services/trackbacks/314627.html</trackback:ping><description><![CDATA[<P>怎样在NHibernate中执行类似的SQL语句：select max(orderNo) as result&nbsp;from tRole？？<BR></P>
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG id=Codehighlighter1_0_374_Closed_Image onclick="this.style.display='none'; Codehighlighter1_0_374_Closed_Text.style.display='none'; Codehighlighter1_0_374_Open_Image.style.display='inline'; Codehighlighter1_0_374_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align=top><IMG id=Codehighlighter1_0_374_Open_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_0_374_Open_Text.style.display='none'; Codehighlighter1_0_374_Closed_Image.style.display='inline'; Codehighlighter1_0_374_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><SPAN id=Codehighlighter1_0_374_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">获取最大序号的角色</SPAN><SPAN id=Codehighlighter1_0_374_Open_Text style="DISPLAY: none"><SPAN style="COLOR: #0000ff">#region</SPAN><SPAN style="COLOR: #000000">&nbsp;获取最大序号的角色</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;Persistent.Role&nbsp;MaxOrderNoRole()<BR><IMG id=Codehighlighter1_65_360_Open_Image onclick="this.style.display='none'; Codehighlighter1_65_360_Open_Text.style.display='none'; Codehighlighter1_65_360_Closed_Image.style.display='inline'; Codehighlighter1_65_360_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_65_360_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_65_360_Closed_Text.style.display='none'; Codehighlighter1_65_360_Open_Image.style.display='inline'; Codehighlighter1_65_360_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_65_360_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/Images/dot.gif"></SPAN><SPAN id=Codehighlighter1_65_360_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Persistent.Role&nbsp;result&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;Role();<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">try</SPAN><SPAN style="COLOR: #000000"><BR><IMG id=Codehighlighter1_117_296_Open_Image onclick="this.style.display='none'; Codehighlighter1_117_296_Open_Text.style.display='none'; Codehighlighter1_117_296_Closed_Image.style.display='inline'; Codehighlighter1_117_296_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_117_296_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_117_296_Closed_Text.style.display='none'; Codehighlighter1_117_296_Open_Image.style.display='inline'; Codehighlighter1_117_296_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_117_296_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/Images/dot.gif"></SPAN><SPAN id=Codehighlighter1_117_296_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.Collections.IList&nbsp;ilist&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;session.Find(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">from&nbsp;Role&nbsp;as&nbsp;a&nbsp;order&nbsp;by&nbsp;a.OrderNo&nbsp;desc</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(ilist.Count&nbsp;</SPAN><SPAN style="COLOR: #000000">!=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">)<BR><IMG id=Codehighlighter1_242_291_Open_Image onclick="this.style.display='none'; Codehighlighter1_242_291_Open_Text.style.display='none'; Codehighlighter1_242_291_Closed_Image.style.display='inline'; Codehighlighter1_242_291_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_242_291_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_242_291_Closed_Text.style.display='none'; Codehighlighter1_242_291_Open_Image.style.display='inline'; Codehighlighter1_242_291_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_242_291_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/Images/dot.gif"></SPAN><SPAN id=Codehighlighter1_242_291_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;ilist[</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">]&nbsp;</SPAN><SPAN style="COLOR: #0000ff">as</SPAN><SPAN style="COLOR: #000000">&nbsp;Persistent.Role;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">finally</SPAN><SPAN style="COLOR: #000000"><BR><IMG id=Codehighlighter1_312_338_Open_Image onclick="this.style.display='none'; Codehighlighter1_312_338_Open_Text.style.display='none'; Codehighlighter1_312_338_Closed_Image.style.display='inline'; Codehighlighter1_312_338_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_312_338_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_312_338_Closed_Text.style.display='none'; Codehighlighter1_312_338_Open_Image.style.display='inline'; Codehighlighter1_312_338_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_312_338_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/Images/dot.gif"></SPAN><SPAN id=Codehighlighter1_312_338_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;session.Close();<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;result;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">#endregion</SPAN></SPAN></DIV><img src ="http://www.cnblogs.com/zsy/aggbug/314627.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43604/" target="_blank">[新闻]微软公布免费安全软件计划</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>NHibernate中DateTime,int,bool空值的处理方法</title><link>http://www.cnblogs.com/zsy/archive/2006/01/06/312488.html</link><dc:creator>小朱</dc:creator><author>小朱</author><pubDate>Fri, 06 Jan 2006 09:20:00 GMT</pubDate><guid>http://www.cnblogs.com/zsy/archive/2006/01/06/312488.html</guid><wfw:comment>http://www.cnblogs.com/zsy/comments/312488.html</wfw:comment><comments>http://www.cnblogs.com/zsy/archive/2006/01/06/312488.html#Feedback</comments><slash:comments>8</slash:comments><wfw:commentRss>http://www.cnblogs.com/zsy/comments/commentRss/312488.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/zsy/services/trackbacks/312488.html</trackback:ping><description><![CDATA[<P>&nbsp; 我们知道，数据库中DateTime子段允许为空(null)。当我们在ASP.NET中映射为DateTime是就不允为空了。该怎么处理？基本有两种办法： <BR>（1）修改.hbm.xml文件中的类型，该"DateTime"为"String"，该实体文件中的属性类型"DateTime"为"String"。 <BR>&nbsp;&nbsp;&nbsp; 处理的时候，该属性值要么为空，要么是具有正确日期格式的字符串。 <BR>&nbsp; 该方法只适合DateTime类型，而对int,bool类型就不适应了。下面就看第二种方法。 <BR>（2）Nullables处理 <BR>&nbsp;&nbsp;&nbsp; (1)添加引用：Nullables.dll与Nullables.NHibernate.dll <BR>&nbsp;&nbsp;&nbsp; (2)修改配置文件.hbm.xml对应的类型，如： <BR>&nbsp;&nbsp; &lt;property name="InDate" column="inDate" type="DateTime"/&gt;修改为： <BR>&nbsp;&nbsp; &lt;property name="InDate" column="inDate" type="Nullables.NHibernate.NullableDateTimeType,Nullables.NHibernate"/&gt; <BR>&nbsp;&nbsp;&nbsp; (3)修改实体类文件，如： <BR>&nbsp;&nbsp;&nbsp; private DateTime _inDate; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/// &lt;summary&gt; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// 添加日期 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// &lt;/summary&gt; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public DateTime InDate <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; get { return _inDate; } <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set { _inDate = value; <BR>&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp; 修改为： <BR>&nbsp;&nbsp;&nbsp;&nbsp; private Nullables.NullableDateTime _InDate; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// &lt;summary&gt; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// 添加日期 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// &lt;/summary&gt; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [NHibernate.Mapping.Attributes.Property] <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public Nullables.NullableDateTime InDate <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; get { return _InDate; } <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set { _InDate = value; } <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <BR>&nbsp;&nbsp;&nbsp;&nbsp; (4)给属性InDate赋值： <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Item clsItem = new Item(); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clsItem.InDate = new NullableDateTime(System.DateTime.Now); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果要输入空值，如：clsItem.InDate = nulll; <BR><BR>&nbsp;&nbsp;&nbsp;&nbsp; (5)获取属性InDate的值：<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ItemCRUD clsCRUD = new ItemCRUD();&nbsp;&nbsp;//对实体类的操作<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Item clsItem = clsCRUD.ItemDetails(id);&nbsp; //获取实体类<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.txtInDate.Text = clsItem.InDate.ToString();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 通过第二种方法可以对数据库中对应的整形、bool类型等赋空值。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 生成实体类的CodeSmith模版：<A href="http://zsy.cnblogs.com/Files/zsy/NHibernate_Entity.rar" target="">/Files/zsy/NHibernate_Entity.rar</A><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 生成.hbm.xml的CodeSmith模版：<A href="http://zsy.cnblogs.com/Files/zsy/NHibernate_Mapping.rar">/Files/zsy/NHibernate_Mapping.rar</A></P><img src ="http://www.cnblogs.com/zsy/aggbug/312488.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43603/" target="_blank">[新闻]《时代》：杨致远被Google玩弄于股掌之间？</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>利用CodeSmith生成NHibernate的被持久化的.Net类</title><link>http://www.cnblogs.com/zsy/archive/2006/01/05/311257.html</link><dc:creator>小朱</dc:creator><author>小朱</author><pubDate>Thu, 05 Jan 2006 01:28:00 GMT</pubDate><guid>http://www.cnblogs.com/zsy/archive/2006/01/05/311257.html</guid><wfw:comment>http://www.cnblogs.com/zsy/comments/311257.html</wfw:comment><comments>http://www.cnblogs.com/zsy/archive/2006/01/05/311257.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cnblogs.com/zsy/comments/commentRss/311257.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/zsy/services/trackbacks/311257.html</trackback:ping><description><![CDATA[<A href="http://zsy.cnblogs.com/Files/zsy/NHibenate_MappingCS.rar" target="">/Files/zsy/NHibenate_MappingCS.rar</A><BR>里面是CodeSmith的模版文件cst。<img src ="http://www.cnblogs.com/zsy/aggbug/311257.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43602/" target="_blank">[新闻]Mozilla即将结束对FireFox 2的支持</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>Common_GetWeek</title><link>http://www.cnblogs.com/zsy/archive/2006/01/05/311253.html</link><dc:creator>小朱</dc:creator><author>小朱</author><pubDate>Thu, 05 Jan 2006 01:17:00 GMT</pubDate><guid>http://www.cnblogs.com/zsy/archive/2006/01/05/311253.html</guid><wfw:comment>http://www.cnblogs.com/zsy/comments/311253.html</wfw:comment><comments>http://www.cnblogs.com/zsy/archive/2006/01/05/311253.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/zsy/comments/commentRss/311253.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/zsy/services/trackbacks/311253.html</trackback:ping><description><![CDATA[<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG id=Codehighlighter1_0_914_Open_Image onclick="this.style.display='none'; Codehighlighter1_0_914_Open_Text.style.display='none'; Codehighlighter1_0_914_Closed_Image.style.display='inline'; Codehighlighter1_0_914_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_0_914_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_0_914_Closed_Text.style.display='none'; Codehighlighter1_0_914_Open_Image.style.display='inline'; Codehighlighter1_0_914_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align=top><SPAN id=Codehighlighter1_0_914_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</SPAN><SPAN id=Codehighlighter1_0_914_Open_Text><SPAN style="COLOR: #008080">/*</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>******************************************************************************************<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;存储过程名称：Common_GetWeek<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;存储过程功能：<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;操&nbsp;作&nbsp;说&nbsp;明&nbsp;：<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;设&nbsp;计&nbsp;时&nbsp;间&nbsp;：2005年08月14日&nbsp;22:00<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;代码设计者：小朱(zsy619@163.com)<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>******************************************************************************************<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;功能描述：<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>******************************************************************************************<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;如果您修改了我的程序，请留下修改记录，以便对程序进行维护，谢谢&nbsp;&nbsp;！！！<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>==========================================================================================<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;修改人&nbsp;&nbsp;&nbsp;修改时间&nbsp;&nbsp;&nbsp;&nbsp;修改原因<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>------------------------------------------------------------------------------------------<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>=======================================================================================<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>******************************************************************************************<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;备注：<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>******************************************************************************************<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top></SPAN><SPAN style="COLOR: #008080">*/</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">CREATE</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">PROCEDURE</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #ff0000">[</SPAN><SPAN style="COLOR: #ff0000">dbo</SPAN><SPAN style="COLOR: #ff0000">]</SPAN><SPAN style="COLOR: #000000">.</SPAN><SPAN style="COLOR: #ff0000">[</SPAN><SPAN style="COLOR: #ff0000">Common_GetWeek</SPAN><SPAN style="COLOR: #ff0000">]</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">@inputDt</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">DateTime</SPAN><SPAN style="COLOR: #000000">,<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">@result</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">int</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #808080">=</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">3</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">【1：返回周如：26；2：返回周如：26周；返回年周如：2005年第26周】</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">As</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Declare</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #008000">@intResult</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">Int</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Begin</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Tran</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">---------------------------------------------------------------代码设计--------------------------------------------------------------------</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Declare</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #008000">@week</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">VarChar</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">12</SPAN><SPAN style="COLOR: #000000">)<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Set</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #008000">@week</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #808080">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #ff00ff">Convert</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">varchar</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">12</SPAN><SPAN style="COLOR: #000000">),&nbsp;</SPAN><SPAN style="COLOR: #ff00ff">DatePart</SPAN><SPAN style="COLOR: #000000">(week,</SPAN><SPAN style="COLOR: #008000">@inputDt</SPAN><SPAN style="COLOR: #000000">))<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Select</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #ff00ff">Case</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #008000">@result</SPAN><SPAN style="COLOR: #000000">&nbsp;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">When</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">1</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Then</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #008000">@week</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">When</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">2</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Then</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #008000">@week</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">周</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Else</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #ff00ff">Convert</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">varchar</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">10</SPAN><SPAN style="COLOR: #000000">),</SPAN><SPAN style="COLOR: #ff00ff">DatePart</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #ff00ff">year</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #008000">@inputDt</SPAN><SPAN style="COLOR: #000000">))&nbsp;</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">年第</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #008000">@week</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">周</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">End</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">As</SPAN><SPAN style="COLOR: #000000">&nbsp;wk<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Set</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #008000">@intResult</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #808080">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #008000">@@ROWCOUNT</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">--------------------------------------------------------------------------------------------------------------------------------------------------</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">If</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #008000">@@Error</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;&gt;</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">0</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Begin</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">RollBack</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Tran</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Return</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #808080">-</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">1</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">End</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Else</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Begin</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Commit</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Tran</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Return</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #008000">@intResult</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">End</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">GO</SPAN></DIV><img src ="http://www.cnblogs.com/zsy/aggbug/311253.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43602/" target="_blank">[新闻]Mozilla即将结束对FireFox 2的支持</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>数据库分页存储过程（7）</title><link>http://www.cnblogs.com/zsy/archive/2006/01/05/311247.html</link><dc:creator>小朱</dc:creator><author>小朱</author><pubDate>Thu, 05 Jan 2006 01:14:00 GMT</pubDate><guid>http://www.cnblogs.com/zsy/archive/2006/01/05/311247.html</guid><wfw:comment>http://www.cnblogs.com/zsy/comments/311247.html</wfw:comment><comments>http://www.cnblogs.com/zsy/archive/2006/01/05/311247.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/zsy/comments/commentRss/311247.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/zsy/services/trackbacks/311247.html</trackback:ping><description><![CDATA[<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG id=Codehighlighter1_0_1003_Open_Image onclick="this.style.display='none'; Codehighlighter1_0_1003_Open_Text.style.display='none'; Codehighlighter1_0_1003_Closed_Image.style.display='inline'; Codehighlighter1_0_1003_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_0_1003_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_0_1003_Closed_Text.style.display='none'; Codehighlighter1_0_1003_Open_Image.style.display='inline'; Codehighlighter1_0_1003_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align=top><SPAN id=Codehighlighter1_0_1003_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</SPAN><SPAN id=Codehighlighter1_0_1003_Open_Text><SPAN style="COLOR: #008080">/*</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>******************************************************************************************<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;过程名称：Common_ColumnType_Pagination<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;过程功能：<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;代码设计：小朱(zsy619@163.com)<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;设计时间：2005-11-3&nbsp;13:58:26<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>******************************************************************************************<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;功能描述：<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>******************************************************************************************<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;如果您修改了我的程序，请留下修改记录，以便对程序进行维护，谢谢&nbsp;&nbsp;！！！<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>==========================================================================================<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;修改人&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;修改时间&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;修改原因<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>------------------------------------------------------------------------------------------<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>==========================================================================================<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>******************************************************************************************<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;备注：对指定表中满足条件的记录按指定列进行分页查询，分页可以顺序、倒序&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;查询可以指定页大小、指定查询任意页、指定输出字段列表，返回总页数<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>*****************************************************************************************<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top></SPAN><SPAN style="COLOR: #008080">*/</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">Create</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Procedure</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #ff0000">[</SPAN><SPAN style="COLOR: #ff0000">dbo</SPAN><SPAN style="COLOR: #ff0000">]</SPAN><SPAN style="COLOR: #000000">.</SPAN><SPAN style="COLOR: #ff0000">[</SPAN><SPAN style="COLOR: #ff0000">Common_ColumnType_Pagination</SPAN><SPAN style="COLOR: #ff0000">]</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">@tb</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">varchar</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">50</SPAN><SPAN style="COLOR: #000000">),&nbsp;</SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">表名&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">@col</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">varchar</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">50</SPAN><SPAN style="COLOR: #000000">),&nbsp;</SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">按该列来进行分页&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">@coltype</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">int</SPAN><SPAN style="COLOR: #000000">,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">@col列的类型,0-数字类型,1-字符类型,2-日期时间类型&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">@orderby</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">bit</SPAN><SPAN style="COLOR: #000000">,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">排序,0-顺序,1-倒序&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">@collist</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">varchar</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">800</SPAN><SPAN style="COLOR: #000000">),</SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">要查询出的字段列表,*表示全部字段&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">@pagesize</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">int</SPAN><SPAN style="COLOR: #000000">,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">每页记录数&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">@page</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">int</SPAN><SPAN style="COLOR: #000000">,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">指定页&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">@condition</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">varchar</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">800</SPAN><SPAN style="COLOR: #000000">),</SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">查询条件&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">@pages</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">int</SPAN><SPAN style="COLOR: #000000">&nbsp;OUTPUT&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">总页数</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">AS</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Declare</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #008000">@intResult</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">Int</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Begin</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Tran</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">---------------------------------------------------------------代码设计--------------------------------------------------------------------</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">DECLARE</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #008000">@sql</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">nvarchar</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">4000</SPAN><SPAN style="COLOR: #000000">),</SPAN><SPAN style="COLOR: #008000">@where1</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">varchar</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">800</SPAN><SPAN style="COLOR: #000000">),</SPAN><SPAN style="COLOR: #008000">@where2</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">varchar</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">800</SPAN><SPAN style="COLOR: #000000">)<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">IF</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #008000">@condition</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">is</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #808080">or</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #ff00ff">rtrim</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #008000">@condition</SPAN><SPAN style="COLOR: #000000">)</SPAN><SPAN style="COLOR: #808080">=</SPAN><SPAN style="COLOR: #ff0000">''</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">BEGIN</SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">没有查询条件&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">SET</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #008000">@where1</SPAN><SPAN style="COLOR: #808080">=</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">&nbsp;WHERE&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #000000">&nbsp;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">SET</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #008000">@where2</SPAN><SPAN style="COLOR: #808080">=</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">END</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">ELSE</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">BEGIN</SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">有查询条件&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">SET</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #008000">@where1</SPAN><SPAN style="COLOR: #808080">=</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">&nbsp;WHERE&nbsp;(</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #008000">@condition</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">)&nbsp;AND&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">本来有条件再加上此条件&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">SET</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #008000">@where2</SPAN><SPAN style="COLOR: #808080">=</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">&nbsp;WHERE&nbsp;(</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #008000">@condition</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">)&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">原本没有条件而加上此条件</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">END</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">SET</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #008000">@sql</SPAN><SPAN style="COLOR: #808080">=</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">SELECT&nbsp;@pages=CEILING((COUNT(*)+0.0)/</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #ff00ff">CAST</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #008000">@pagesize</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">AS</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">varchar</SPAN><SPAN style="COLOR: #000000">)</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">)&nbsp;FROM&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #008000">@tb</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #008000">@where2</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">EXEC</SPAN><SPAN style="COLOR: #000000">&nbsp;sp_executesql&nbsp;</SPAN><SPAN style="COLOR: #008000">@sql</SPAN><SPAN style="COLOR: #000000">,N</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">@pages&nbsp;int&nbsp;OUTPUT</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #008000">@pages</SPAN><SPAN style="COLOR: #000000">&nbsp;OUTPUT</SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">计算总页数</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">IF</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #008000">@orderby</SPAN><SPAN style="COLOR: #808080">=</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">0</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">SET</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #008000">@sql</SPAN><SPAN style="COLOR: #808080">=</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">SELECT&nbsp;TOP&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #ff00ff">CAST</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #008000">@pagesize</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">AS</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">varchar</SPAN><SPAN style="COLOR: #000000">)</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #008000">@collist</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">&nbsp;FROM&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #008000">@tb</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #008000">@where1</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #008000">@col</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">&gt;(SELECT&nbsp;MAX(</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #008000">@col</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">)&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">&nbsp;FROM&nbsp;(SELECT&nbsp;TOP&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #ff00ff">CAST</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #008000">@pagesize</SPAN><SPAN style="COLOR: #808080">*</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #008000">@page</SPAN><SPAN style="COLOR: #808080">-</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">1</SPAN><SPAN style="COLOR: #000000">)&nbsp;</SPAN><SPAN style="COLOR: #0000ff">AS</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">varchar</SPAN><SPAN style="COLOR: #000000">)</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">@col</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">&nbsp;FROM&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #008000">@tb</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #008000">@where2</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">ORDER&nbsp;BY&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #008000">@col</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">)&nbsp;t)&nbsp;ORDER&nbsp;BY&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #008000">@col</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">ELSE</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">SET</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #008000">@sql</SPAN><SPAN style="COLOR: #808080">=</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">SELECT&nbsp;TOP&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #ff00ff">CAST</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #008000">@pagesize</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">AS</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">varchar</SPAN><SPAN style="COLOR: #000000">)</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #008000">@collist</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">&nbsp;FROM&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #008000">@tb</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #008000">@where1</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #008000">@col</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">&lt;(SELECT&nbsp;MIN(</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #008000">@col</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">)&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">&nbsp;FROM&nbsp;(SELECT&nbsp;TOP&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #ff00ff">CAST</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #008000">@pagesize</SPAN><SPAN style="COLOR: #808080">*</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #008000">@page</SPAN><SPAN style="COLOR: #808080">-</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">1</SPAN><SPAN style="COLOR: #000000">)&nbsp;</SPAN><SPAN style="COLOR: #0000ff">AS</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">varchar</SPAN><SPAN style="COLOR: #000000">)</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #000000">&nbsp;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">@col</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">&nbsp;FROM&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #008000">@tb</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #008000">@where2</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">ORDER&nbsp;BY&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #008000">@col</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">&nbsp;DESC)&nbsp;t)&nbsp;ORDER&nbsp;BY&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #008000">@col</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">&nbsp;DESC</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">IF</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #008000">@page</SPAN><SPAN style="COLOR: #808080">=</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">1</SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">第一页&nbsp;</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">SET</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #008000">@sql</SPAN><SPAN style="COLOR: #808080">=</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">SELECT&nbsp;TOP&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #ff00ff">CAST</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #008000">@pagesize</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">AS</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">varchar</SPAN><SPAN style="COLOR: #000000">)</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #008000">@collist</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">&nbsp;FROM&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #008000">@tb</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">@where2</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">ORDER&nbsp;BY&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #008000">@col</SPAN><SPAN style="COLOR: #808080">+</SPAN><SPAN style="COLOR: #ff00ff">CASE</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #008000">@orderby</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">WHEN</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">0</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">THEN</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #ff0000">''</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">ELSE</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">&nbsp;DESC</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">END</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">EXEC</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #008000">@sql</SPAN><SPAN style="COLOR: #000000">)<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Set</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #008000">@intResult</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #808080">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #008000">@@ROWCOUNT</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">--------------------------------------------------------------------------------------------------------------------------------------------------</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">If</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #008000">@@Error</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;&gt;</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">0</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Begin</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">RollBack</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Tran</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Return</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #808080">-</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">1</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">End</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Else</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Begin</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Commit</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Tran</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Return</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #008000">@intResult</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">End</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">GO</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN></DIV><img src ="http://www.cnblogs.com/zsy/aggbug/311247.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43602/" target="_blank">[新闻]Mozilla即将结束对FireFox 2的支持</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>数据库分页存储过程（6）</title><link>http://www.cnblogs.com/zsy/archive/2006/01/05/311244.html</link><dc:creator>小朱</dc:creator><author>小朱</author><pubDate>Thu, 05 Jan 2006 01:13:00 GMT</pubDate><guid>http://www.cnblogs.com/zsy/archive/2006/01/05/311244.html</guid><wfw:comment>http://www.cnblogs.com/zsy/comments/311244.html</wfw:comment><comments>http://www.cnblogs.com/zsy/archive/2006/01/05/311244.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/zsy/comments/commentRss/311244.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/zsy/services/trackbacks/311244.html</trackback:ping><description><![CDATA[<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG id=Codehighlighter1_0_919_Open_Image onclick="this.style.display='none'; Codehighlighter1_0_919_Open_Text.style.display='none'; Codehighlighter1_0_919_Closed_Image.style.display='inline'; Codehighlighter1_0_919_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_0_919_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_0_919_Closed_Text.style.display='none'; Codehighlighter1_0_919_Open_Image.style.display='inline'; Codehighlighter1_0_919_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align=top><SPAN id=Codehighlighter1_0_919_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</SPAN><SPAN id=Codehighlighter1_0_919_Open_Text><SPAN style="COLOR: #008080">/*</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>******************************************************************************************<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;过程名称：Common_Type_Pagination<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;过程功能：<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;代码设计：小朱(zsy619@163.com)<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;设计时间：2005-11-3&nbsp;13:58:26<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>******************************************************************************************<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;功能描述：<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>******************************************************************************************<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;如果您修改了我的程序，请留下修改记录，以便对程序进行维护，谢谢&nbsp;&nbsp;！！！<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>==========================================================================================<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;修改人&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;修改时间&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;修改原因<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>------------------------------------------------------------------------------------------<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>==========================================================================================<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>******************************************************************************************<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;备注：<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>*****************************************************************************************<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top></SPAN><SPAN style="COLOR: #008080">*/</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">Create</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Procedure</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #ff0000">[</SPAN><SPAN style="COLOR: #ff0000">dbo</SPAN><SPAN style="COLOR: #ff0000">]</SPAN><SPAN style="COLOR: #000000">.</SPAN><SPAN style="COLOR: #ff0000">[</SPAN><SPAN style="COLOR: #ff0000">Common_Type_Pagination</SPAN><SPAN style="COLOR: #ff0000">]</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">@tblName</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">varchar</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">255</SPAN><SPAN style="COLOR: #000000">),&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">&nbsp;表名&nbsp;</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">@strGetFields</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">varchar</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">1000</SPAN><SPAN style="COLOR: #000000">)&nbsp;</SPAN><SPAN style="COLOR: #808080">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">*</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #000000">,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">&nbsp;需要返回的列名&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">@strWhere</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">varchar</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">1500</SPAN><SPAN style="COLOR: #000000">)&nbsp;</SPAN><SPAN style="COLOR: #808080">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #ff0000">''</SPAN><SPAN style="COLOR: #000000">,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">&nbsp;查询条件&nbsp;(注意:&nbsp;不要加&nbsp;where)&nbsp;</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">@fldName</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">varchar</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">255</SPAN><SPAN style="COLOR: #000000">)</SPAN><SPAN style="COLOR: #808080">=</SPAN><SPAN style="COLOR: #ff0000">''</SPAN><SPAN style="COLOR: #000000">,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">&nbsp;排序的字段名&nbsp;</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">@orderType</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">bit</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #808080">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">0</SPAN><SPAN style="COLOR: #000000">,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">&nbsp;设置排序类型,&nbsp;0&nbsp;值为升序,&nbsp;非&nbsp;0&nbsp;值为降序&nbsp;</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">@pageSize</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">int</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #808080">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">10</SPAN><SPAN style="COLOR: #000000">,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">&nbsp;页尺寸&nbsp;</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">@pageIndex</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">int</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #808080">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">1</SPAN><SPAN style="COLOR: #000000">,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">&nbsp;页码&nbsp;</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">@returnType</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">bit</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #808080">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">0</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">&nbsp;设置返回类型，0&nbsp;值为返回记录集,&nbsp;非&nbsp;0&nbsp;值为返回记录总数&nbsp;</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">AS</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Declare</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #008000">@intResult</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">Int</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Begin</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Tran</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">---------------------------------------------------------------代码设计--------------------------------------------------------------------</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">declare</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #008000">@strSQL</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">varchar</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">5000</SPAN><SPAN style="COLOR: #000000">)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="COLOR: #008080">&nbsp;主语句&nbsp;</SPAN><SPAN style="COLOR: #008080"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">declare</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #008000">@strTmp</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">varchar</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">110</SPAN><SPAN style="COLOR: #000000">)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008080">--</SPAN><SPAN style="CO