CREATE PROCEDURE Proc_GetRecordByPage --'v_EmailInfoRecive','PK_EmailReceive','*',10,2,0,0,' PK_Employee=1' --and (SendDate<=''2007-4-14 13:20:05'' and SendDate>=''2007-3-14 13:20:04'') and IsRead=''未读'' '
@tblName varchar(255), -- 表名
@fldName varchar(255), -- 主键字段名
@DisName varchar(255), --显示列字符串 * 或 PK_ID,Name
@PageSize int, -- 页尺寸
@PageIndex int, -- 页码
@IsReCount bit, -- 返回记录总数, 非 0 值则返回
@OrderType bit, -- 设置排序类型, 非 0 值则降序
@strWhere varchar(1000) -- 查询条件 (注意: 不要加 where,可加分组 Group by)
AS
declare @strSQL varchar(6000) -- 主语句
declare @strTmp varchar(4000) -- 临时变量
declare @strOrder varchar(4000) -- 排序类型
if @OrderType != 0
begin
set @strTmp = '<(select min'
set @strOrder = ' order by [' + @fldName +'] desc'
end
else
begin
set @strTmp = '>(select max'
set @strOrder = ' order by [' + @fldName +'] asc'
end
set @strSQL = 'select top ' + str(@PageSize) + ' '+@DisName+' from ['
+ @tblName + '] where [' + @fldName + ']' + @strTmp + '(['
+ @fldName + ']) from (select top ' + str((@PageIndex-1)*@PageSize) + ' ['
+ @fldName + '] from [' + @tblName + ']' + @strOrder + ') as tblTmp)'
+ @strOrder
if @strWhere !=' '
set @strSQL = 'select top ' + str(@PageSize) + ' '+@DisName+' from ['
+ @tblName + '] where [' + @fldName + ']' + @strTmp + '(['
+ @fldName + ']) from (select top ' + str((@PageIndex-1)*@PageSize) + ' ['
+ @fldName + '] from [' + @tblName + '] where ' + @strWhere + ' '
+ @strOrder + ') as tblTmp) and ' + @strWhere +' '+@strOrder
if @PageIndex = 1
begin
set @strTmp =''
if @strWhere != ' '
set @strTmp = ' where ' + @strWhere
set @strSQL = 'select top ' + str(@PageSize) + ' '+@DisName+' from ['
+ @tblName + ']' + @strTmp + ' ' + @strOrder
end
if @IsReCount ! = 0
Begin
if @strWhere !=''
set @strSQL = 'select count(*) as Total from ( select '+@DisName+' from [' + @tblName + ']'+' where ' + @strWhere+') as tmptable'
else
set @strSQL = 'select count(*) as Total from ( select '+@DisName+' from [' + @tblName + '] ) as tmptable'
end
--print @strSQL
exec (@strSQL)
GO
没有合适的资源?快使用搜索试试~ 我知道了~
C#WinFrom分页控件
共58个文件
cs:11个
pdb:10个
dll:7个
5星 · 超过95%的资源 需积分: 21 49 下载量 65 浏览量
2008-12-03
11:28:33
上传
评论 2
收藏 169KB RAR 举报
温馨提示
自己写的一个动态的分页控件并附带分页存储过程和源码示例
资源推荐
资源详情
资源评论
收起资源包目录
WinFrom分页控件.rar (58个子文件)
WindowsApplication23
PaginationControlLibrary
bin
Debug
PaginationControlLibrary.pdb 28KB
PaginationControlLibrary.dll 24KB
Release
PaginationControlLibrary.pdb 26KB
PaginationControlLibrary.dll 24KB
obj
PaginationControlLibrary.csproj.FileList.txt 692B
Debug
PaginationControlLibrary.csproj.GenerateResource.Cache 788B
PaginationControlLibrary.pdb 28KB
Refactor
PaginationControlLibrary.dll 16KB
TempPE
PaginationControlLibrary.dll 24KB
PaginationControlLibrary.PaginationControlLibrary.resources 180B
Release
PaginationControlLibrary.csproj.GenerateResource.Cache 788B
PaginationControlLibrary.pdb 26KB
TempPE
PaginationControlLibrary.dll 24KB
PaginationControlLibrary.PaginationControlLibrary.resources 180B
PaginationControlLibrary.Designer.cs 6KB
Proc_GetRecordByPage.txt 2KB
Properties
AssemblyInfo.cs 1KB
PaginationControlLibrary.cs 17KB
PaginationControlLibrary.csproj 3KB
PaginationControlLibrary.resx 6KB
WindowsApplication2.sln 1KB
WindowsApplication2
WebPage.cs 5KB
Form1.cs 912B
bin
Debug
WindowsApplication2.vshost.exe 6KB
WindowsApplication2.pdb 50KB
PaginationControlLibrary.pdb 28KB
WindowsApplication2.exe 32KB
PaginationControlLibrary.dll 24KB
Release
WindowsApplication2.vshost.exe 6KB
WindowsApplication2.pdb 46KB
PaginationControlLibrary.pdb 26KB
WindowsApplication2.exe 28KB
PaginationControlLibrary.dll 24KB
DbHelperSQL.cs 33KB
obj
WindowsApplication2.csproj.FileList.txt 884B
Debug
WindowsApplication2.Form1.resources 180B
WindowsApplication2.Properties.Resources.resources 180B
WindowsApplication2.pdb 50KB
ResolveAssemblyReference.cache 5KB
WindowsApplication2.exe 32KB
Refactor
TempPE
WindowsApplication2.csproj.GenerateResource.Cache 842B
Release
WindowsApplication2.Form1.resources 180B
WindowsApplication2.Properties.Resources.resources 180B
WindowsApplication2.pdb 46KB
ResolveAssemblyReference.cache 4KB
WindowsApplication2.exe 28KB
TempPE
WindowsApplication2.csproj.GenerateResource.Cache 842B
Properties
Resources.Designer.cs 3KB
Settings.settings 249B
Resources.resx 5KB
Settings.Designer.cs 1KB
AssemblyInfo.cs 1KB
Program.cs 478B
WindowsApplication2.csproj.user 168B
Form1.Designer.cs 3KB
Form1.resx 6KB
WindowsApplication2.csproj 3KB
WindowsApplication2.suo 35KB
共 58 条
- 1
资源评论
- yesyihua2016-02-23存储过程分页不错..
- tu6782013-02-22很不错 有源码 方便学习
- szqqjianhua2012-09-11存贮过程分页不错,可用,但WINFORM 用户控件用不了。。。
bineran
- 粉丝: 5
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功