Click here to Skip to main content
11,642,855 members (75,168 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
how to show only 10 values in gridview without using paging in asp.net with c#.
Posted 18-Jan-13 3:38am
Comments
BC @ CV at 18-Jan-13 9:40am
   
"without using paging...", So you want to just show the top 10 and that's it?
Member 9581488 at 18-Jan-13 9:41am
   
as stated by BC @ CV . Use top 10 in your select statement.
Nandakishorerao at 18-Jan-13 23:16pm
   
paste the code what you have done till now?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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
  Permalink  

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

  Print Answers RSS
0 DamithSL 258
1 Sergey Alexandrovich Kryukov 230
2 jyo.net 180
3 OriginalGriff 170
4 Afzaal Ahmad Zeeshan 155
0 Mika Wendelius 485
1 DamithSL 457
2 OriginalGriff 365
3 Afzaal Ahmad Zeeshan 258
4 Sergey Alexandrovich Kryukov 254


Advertise | Privacy | Mobile
Web03 | 2.8.150731.1 | Last Updated 18 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100