Results 1 to 3 of 3

Thread: [RESOLVED] RecordsPerPage

  1. #1
    Hyperactive Member
    Join Date
    Apr 06
    Posts
    384

    Resolved [RESOLVED] RecordsPerPage

    Hi all, I'm using ASP.NET (VB) and the "Repeater" to show results from database (MS ACCESS) .. I want to know how can I make it to show only the first or top 10 results in my database ... (Such as in classic asp i can use RecordsPerPage function to set this).

    This is the sub where I check if there was results (show them) or if not (redirect):

    Code:
    Sub CheckHasRows(ByVal dbread)
    	If dbread.hasrows Then
    		Table.datasource = dbread
    		Table.databind()
    		dbread.close
    	Else
    		Response.Redirect("/INDEX.aspx")
    	
    	End If
    End Sub

  2. #2
    Fanatic Member eSPiYa's Avatar
    Join Date
    Jun 06
    Location
    in our house
    Posts
    753

    Re: RecordsPerPage

    If you are using ASP.NET 2.0 then you may use GridView control and Enable Paging through smart tag.
    PageSize is the maximum number of rows it will show per page, its default value is 10.

  3. #3
    ASP.NET Moderator mendhak's Avatar
    Join Date
    Feb 02
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,174

    Re: RecordsPerPage

    SELECT TOP 10 * FROM tablename WHERE conditions...blahblah

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •