asp.netϺǫ́³£Ó÷ÖÒ³½â¾ö·½°¸µÄ˼¿¼
SQL
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
--°¢»áéªsosuo8.com¸ù¾ÝÍøÂçÉϵĴúÂë½øÐÐÁËÐ޸ģ¬°æȨ¹éÔ×÷ÕßËùÓÐ2009-4-5
--°¢»áéª×öÁËÒ»´ÎÉý¼¶£¬2009-9-27
--ÐÞ¸ÄÊä³ö×ܼǼÊý
ALTER PROCEDURE [dbo].[pagination]
@tblName nvarchar(1000), -- ±íÃû
@fldName nvarchar(1000), -- ÐèÒª·µ»ØµÄÁÐ
@orderfldName nvarchar(255), -- ÅÅÐòµÄ×Ö¶ÎÃû
@PageSize int, -- Ò³³ß´ç
@PageIndex int, -- Ò³Âë
@OrderType bit, -- ÉèÖÃÅÅÐòÀàÐÍ, ·Ç 0 ÖµÔò½µÐò
@strWhere nvarchar(1500), -- ²éѯÌõ¼þ (×¢Òâ: ²»Òª¼Ó where)
@isCount bit--ÉèÖÃÊÇ·ñ·µ»Ø¼Ç¼×ÜÊý£¬0²»·µ»Ø¡¢1·µ»Ø
AS
declare @strSQL nvarchar(4000) -- Ö÷Óï¾ä
declare @strTmp nvarchar(110) -- ÁÙʱ±äÁ¿
declare @strOrder nvarchar(400) -- ÅÅÐòÀàÐÍ
--declare @timediff datetime --ºÄʱ
begin
--select @timediff = Getdate()
--if @strWhere !=''
if @isCount = 1
exec('select count(*) from ' + @tblName + ' where '+@strWhere)
Else
if @OrderType != 0
begin
set @strTmp = '<(select min'
set @strOrder = ' order by ' + @orderfldName +' desc'
--Èç¹û@OrderType²»ÊÇ0£¬¾ÍÖ´ÐнµÐò£¬Õâ¾äºÜÖØÒª£¡
end
else
begin
set @strTmp = '>(select max'
set @strOrder = ' order by ' + @orderfldName +' asc'
end
if @PageIndex = 1
begin
if @strWhere != ''
set @strSQL = 'select top ' + str(@PageSize) +' '+@fldName+ ' from ' + @tblName + ' where ' +
Ïà¹ØÎĵµ£º
ASP.NET ÅäÖýڼܹ¹°üº¬¿ØÖÆ ASP.NET Web Ó¦ÓóÌÐòÐÐΪµÄÔªËØ¡£Èç¹ûΪÊôÐÔÖ¸¶¨ÁËĬÈÏÖµ£¬Ôò¸ÃĬÈÏÖµÊÇÔÚ Machine.config ÎļþÖÐÉèÖõģ¬¸ÃÎļþµÄ·¾¶ÊÇ systemroot\Microsoft.NET\Framework\versionNumber\CONFIG\Machine.config¡£
<configuration>
<location>
......
×î½üд³ÌÐòÒ»Ö±³öÎÊÌ⣬ÒÔÇ°Ò»¸öÕ¾Èý¼¸Ìì¾ÍÇáËɸ㶨£¬ÏÖÔÚÒ»¸öÄ£¿é¾³£¸ã°ëÌ죬NND
ÏÂÎ翪·¢¿áÒ×»¯×±Æ·É̳Ç(http://www.koyee.net)Ò»¸ö±íµ¥Ìá½»¹¦ÄÜÄ£¿é£¬±¾µØÈκÎÎÊÌⶼûÓÐÁË£¬´«µ½·þÎñÆ÷Éϱ¾ÒÔΪûÊÂÁË£¬ºóÀ´Ò»¼ì²éËùÓеÄÑéÖ¤¿Ø¼þ¶¼²»Æð×÷ÓÃÁË£¬Ö±½Ó¶¼Ìá½»¹ýÈ¥ÁË£¬ÓôÃÆ£¬ÔÒÔΪ³ÌÐò±»¸Ä´íÁË£¬¼ì²é±¾µØ»¹ÊÇûÈκÎÎÊÌ⣬¼ ......
»¶Ó½øÈë.NETÉçÇøÂÛ̳£¬Óë200Íò¼¼ÊõÈËÔ±»¥¶¯½»Á÷ >>½øÈë
ASP.NET Êý¾Ý¿Ø¼þ:GridView,DataList,Repeater ,DetailsView,FormView¡£
ASP.NET Êý¾Ý¿Ø¼þ×ÛÊö£º
1.Ç°3¸öÓÃÓÚ³ÊÏÖ¶àÌõ¼Ç¼,ºóÃæ2¸öÓÃÓÚ³ÊÏÖµ¥ÌõÊý¾ÝÃ÷ϸ,¼´³£ÓõļǼÃ÷ϸ¡£
2.GridViewºÍDetailsView¿Ø¼þµÄ²¼¾Ö¹Ì¶¨,×Ô¶¨ÒåÊý¾ÝÏÔʾµÄ²¼¾Ö¹¦ÄÜÓÐÏÞ,Ò»°ã ......