使用SQL Server 2005的新函数构造分页存储过程
2009-10-25 00:00:00 来源:WEB开发网c#相关代码的数据库访问使用的是微软的企业库 V4.1
Enterprise Library 4.1 下载地址:
http://www.microsoft.com/downloads/details.aspx?FamilyId=1643758B-2986-47F7-B529-3E41584B6CE5&displaylang=en
示例代码,前台页面,前台为用户控件
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="StudentDetailsTable.ascx.cs" Inherits="Kimbanx.UCS.ForeignStudentAdmin.UserControl.UserControl.StudentDetailsTable" %>
<link href="../css/core.css" rel="stylesheet" type="text/css" />
<table class="StudentPagingTablePanel">
<tr>
<td> 单位:<asp:Label ID="lblClassName" runat="server" Text="Label"></asp:Label></td>
<td>级别:<asp:Label ID="lblClassLevel" runat="server" Text="Label"></asp:Label>级节点</td>
</tr>
<tr>
<td>该单位共有<asp:Label ID="lblStudentType" runat="server" Text="Label"></asp:Label>学员
<asp:Label ID="lblStudentCount" runat="server" Text="Label"></asp:Label>人</td>
<td>每页显示<asp:DropDownList ID="ddlPageSize" runat="server" AutoPostBack="True"
onselectedindexchanged="ddlPageSize_SelectedIndexChanged">
</asp:DropDownList>人 共<asp:Label ID="lblPageCount" runat="server" Text="Label"></asp:Label>页
现为第<asp:Label ID="lblPageIndex" runat="server" Text="Label"></asp:Label>页
<asp:LinkButton ID="firstPage" runat="server" CommandArgument="first"
oncommand="LinkButton_Command">首页</asp:LinkButton>
<asp:LinkButton ID="nextPage" runat="server" CommandArgument="next"
oncommand="LinkButton_Command">下一页</asp:LinkButton>
<asp:LinkButton ID="prevPage" runat="server" CommandArgument="prev"
oncommand="LinkButton_Command">上一页</asp:LinkButton>
<asp:LinkButton ID="lastPage" runat="server" CommandArgument="last"
oncommand="LinkButton_Command">末页</asp:LinkButton>
</td>
</tr>
</table>
<br />
<asp:GridView ID="gvStudent" runat="server" AutoGenerateColumns="False"
EmptyDataText="没有符合条件的数据">
<Columns>
<asp:TemplateField HeaderText="照片">
<ItemTemplate>
<asp:Image ID="Image1" CssClass="studentImage" ImageUrl =<%# GetStudentImageUrl(Eval("zpadress")) %> runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="姓名(中英简)">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("xmjz") %>'></asp:Label>
<br />
<asp:Label ID="Label2" runat="server" Text='<%# Eval("xmjy") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="jx" HeaderText="军衔" />
<asp:BoundField DataField="zw" HeaderText="职务" />
<asp:BoundField DataField="gj" HeaderText="国家" />
<asp:BoundField DataField="sjyqk" HeaderText="文化程度" />
<asp:BoundField DataField="zj" HeaderText="宗教" />
<asp:TemplateField HeaderText="出生/入伍">
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# SetBirthDate(Eval("csrq")) %>'></asp:Label>
<br />
<asp:Label ID="Label4" runat="server" Text='<%# SetEnrollDate(Eval("rwrq")) %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="xzz" HeaderText="房间/楼号" />
<asp:TemplateField HeaderText="电话/小号">
<ItemTemplate>
<asp:Label ID="Label5" runat="server" Text='<%# Eval("dhd") %>'></asp:Label>
<br />
<asp:Label ID="Label6" runat="server" Text='<%# Eval("dhx") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="fcjp" HeaderText="返程机票" />
<asp:BoundField DataField="xh" HeaderText="学号" />
</Columns>
</asp:GridView>
- ››sql server自动生成批量执行SQL脚本的批处理
- ››使用linux中的quota教程
- ››sql server 2008亿万数据性能优化
- ››SQL Server 2008清空数据库日志方法
- ››sqlserver安装和简单的使用
- ››SQL Sever 2008 R2 数据库管理
- ››使用jxl生成带动态折线图的excel
- ››SQL SERVER无法安装成功,sqlstp.log文件提示[未发...
- ››Sql Server中通过父记录查找出所有关联的子记录
- ››SqlServer触发器、存储过程和函数
- ››SQL Server 中的事务(含义,属性,管理)
- ››Sqlite数据库插入和读取图片数据
更多精彩
赞助商链接