Click here to Skip to main content
15,896,154 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to show only 10 values in gridview without using paging in asp.net with c#.
Posted
Comments
BC @ CV 18-Jan-13 9:40am    
"without using paging...", So you want to just show the top 10 and that's it?
Member 9581488 18-Jan-13 9:41am    
as stated by BC @ CV . Use top 10 in your select statement.
Nandakishore G N 18-Jan-13 23:16pm    
paste the code what you have done till now?

hi you can do it with sql query
if u wanna get only 1 to 10 rowns i do with select top 10 * from tabel
but if u wanna get from 20 to 30 or 40 to 50 u must use 2 tops in query

select top 10 id
from table where id in (select top 50 id from table order by id desc)
order by id

with this query u can get from 40 to 50
u must only change number 50 to wich max row u wanna do and how many rows u wanna select u change it to first select hope i this can help u
sry for my bad english good luck
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900