Çë½ÌSQLת»»×Ö·ûÎÊÌâ - .NET¼¼Êõ / ASP.NET
SQL code:
declare @pagecount int
declare @sql varchar(500)
set @pagecount=10
set @sql='select top '+cast(@pagecount as varchar(10))+' * from book order by [ID] desc'
exec (@sql)
Ö´Ðлᱨ´í¡°ÔÚ½« varchar Öµ 'select top 10 * from book order by [ID] desc' ת»»³ÉÊý¾ÝÀàÐÍ int ʱʧ°Ü¡£¡±
ÇëÎÊÕâÀïÔõôƴ×Ö·û£¿Èç¹û±íÃûÊDZäÁ¿ÇëÎÊÔõôƴд£¿
ËÓÐSQLÆ´×Ö·ûµÄ×ÊÁÏ£¿·¢ÍøÖ·£¬Ð»Ð»
¸ÕÊÔÁËÏ£¬ÉÏÃæÕýÈ·£¬µ«ÏÂÃæÕâ¶ÎÖ´ÐеÄʱºò³öÎÊÌ⣿
´´½¨´æ´¢¹ý³Ì
SQL code:
create proc book_page3
@page int,@pagecount int
as
declare @sqls varchar(500)
declare @page2 int
declare @counts int
declare @sqlc int
declare @sqll int
select @counts=count(*) from book
set @sqlc=@counts/@pagecount+1
if @page<=@sqlc and @page<>0
begin
if @page<>1
begin
set @page2=@pagecount*(@page-1)
select top (@pagecount) * from book where [ID]<(select min(ID) from (select top (@page2) ID from book order by [ID] desc)b) order by [ID] desc
end
else
begin
set @page2=@pagecount*@page
select top (@pagecount) * from book order by [ID] desc
end
end
else
begin
set @sqll='select top '+cast(@pagecou
Ïà¹ØÎÊ´ð£º
×Ö¶Î1,×Ö¶Î2.....×Ö¶ÎN,Status,ParentID
1,Name1....test1,1,99
1,Name1....test1,3,99
1,Name2....test2,1,101
1,Name2....test2,3,101
1,Name3....test3,2,101
1,Name1....test1,4,101
ÏëÒªµÄ½á¹ûÊÇ:
1,Na ......
´úÂëÈçÏ Çë¸ßÊÖ Ö¸µãÏ лл
ajax_http.js
-------------
function getXMLHTTP() {
var xmlhttp;
if (window.ActiveXObject) {
//IE
try {
......
ÕâÀïÏëÁ˽âÏ£¬¹ØÓÚSQL ServerÖзÖÒ³ºÍOracleÖзÖÒ³£»
ƽ³£Ð´Ó¦ÓóÌÐòµÄʱºò£¬±ÈÈçÓõÄÓïÑÔÊÇJava£¬ÓиöÁбíÒ³Ã棬ÐèÒª¶ÔÊý¾Ý·ÖÒ³ÏÔʾ£»
ÕâÀïÒª·ÖÒ³ÄѵÀ²»ÐèÒª½èÖúJava£¬¶øÖ±½ÓsqlÄÜÖªµÀ·ÖÒ³Âð£¬ÆðÂëÒ²Òª´«¸öÒ³Âë½ ......
½«Ò»¸ö²éѯÓï¾ä¸³¸øÒ»¸ö±äÁ¿£¬ÈçÏ£º
DECLARE @STR NVARCHAR(MAX)
SET @STR='SELECT * from SALE_PROD'
ÔõôÑù²ÅÄÜÖ´ÐÐËüÄØ£¿
Çë¸ßÊÖ£¬ÈÊÐÖ£¬ÏÀ½ã°ï°ïæ°¡
¶àл£¬¿ÉÒÔÀ²£¬¸ßÊÖ°¡
Ö±½ÓÖ´ÐоÍÐÐÁË
exec ......
ÔÚAccessµÄ²éѯÖÐÖ´ÐÐÏÂÃæµÄÓï¾ä,ÎÞЧ,ÌáʾÆÚ´ýselect ,updata ,...
CreateTble C=Answer N="»ØÌû±í"
(
C=ID T="INTEGER" P=No M=No N="񅧏" Z=false,
C=Ques ......