ASP.NET paging help

G

Guest

Hello friends, i'm bit confused about paging in ASP.NET pls tell me how can i
do paging my database results in ASP.NET without using Datagrid server
control pls help me out.
Thanks
Bye
 
G

gaidar

You can page records manually.

You should use specialized SQL query:

-- selects 10 records depend on pager_id
Select top 10 * from MyTable where id > pager_id * 10

And provide links like:
<< 1 | 2 | 3 >> where href = mypage.aspx?page=1 (or 2, 3)

And get page parameter from QueryString property of Request object (that
will be your pager_id variable).

Gaidar
 
E

Elton Wang

Follwing sql query gives paging result (5 records for each
page):

SELECT Top 5 * FROM table_name WHERE pk_field > @pk_id
ORDER BY pk_field

HTH

Elton Wang
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top