Home > Net >  Consult, paging problem.
Consult, paging problem.

Time:10-03

Using the access database paging source code is written like online problem is running after the first page without the data, the second page with data, and runtime in figure 2 this kind of circumstance!!!!

CodePudding user response:

Select top 0? What is the point?
Should not in (not empty)

CodePudding user response:

Top 0 and the data?

CodePudding user response:

Make a judgment conditions Inum==1 when the SQL statement of the second line does not need to

CodePudding user response:

 
[code=SQL] go
Go
Declare @ pageNum int. - page
Declare @ pageSize int. - the number of columns
Declare @ SQL varchar (Max)
The set @ pageNum=1;
The set @ pageSize=5;
Set @ SQL='select top + cast (@ pageSize as varchar (10)) +' * from WCDJ where wcid not in (select top '+ cast (@ pageSize * (@ pageNum - 1) as a varchar (20)) +' wcid from WCDJ) '
Print @ SQL
The exec SQL) (@

I this is written in SQL, you slightly change the
[/code]
  •  Tags:  
  • C#