Click here to Skip to main content
12,757,627 members (36,807 online)
Rate this:
Please Sign up or sign in to vote.
See more: ASP.NET
how to show only 10 values in gridview without using paging in with c#.
Posted 18-Jan-13 4:38am
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.
Nandakishorerao 18-Jan-13 23:16pm
paste the code what you have done till now?
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Rate this: bad
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

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

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170217.1 | Last Updated 18 Jan 2013
Copyright © CodeProject, 1999-2017
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