Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Paging through Recordset and Database

Paging through Recordset and Database

Scheduled Pinned Locked Moved ASP.NET
databaseperformancetutorial
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    virendra_007
    wrote on last edited by
    #1

    Dear All, I am implementing pagin in my project where I am showing around 10 recordset per page. I want that whenever I click on next page it shouldn't call the database again and again. Data fetching should be done at once. Can anybody tell me how to do this so that I can increase the performance of my database. There are 20,000 records I am getting from this query. Thanks and Regards, Virendra

    A N 2 Replies Last reply
    0
    • V virendra_007

      Dear All, I am implementing pagin in my project where I am showing around 10 recordset per page. I want that whenever I click on next page it shouldn't call the database again and again. Data fetching should be done at once. Can anybody tell me how to do this so that I can increase the performance of my database. There are 20,000 records I am getting from this query. Thanks and Regards, Virendra

      A Offline
      A Offline
      Abolfazl Sheikhloo
      wrote on last edited by
      #2

      tou can fetch data from database and store it in xml file before using in gridview or any control, then work with xml file for paging and sorting or ...

      We Can Do Anything, If We Want It

      N 1 Reply Last reply
      0
      • V virendra_007

        Dear All, I am implementing pagin in my project where I am showing around 10 recordset per page. I want that whenever I click on next page it shouldn't call the database again and again. Data fetching should be done at once. Can anybody tell me how to do this so that I can increase the performance of my database. There are 20,000 records I am getting from this query. Thanks and Regards, Virendra

        N Offline
        N Offline
        N a v a n e e t h
        wrote on last edited by
        #3

        virendra_007 wrote:

        am implementing pagin in my project where I am showing around 10 recordset per page

        What control you are using to show the results ? Is it a datagrid/gridview ? Both supports paging. You can set allowpaging=true and set the pagesize. This method for paging implementation is very easy. But efficient way will be doing the manual paging. First you need to find the total page by **totalrecords/pagesizesize**. Then depending on the page number you need to fetch only 10 records(your page size) from the database for that page. So your page may look like this **www.yourdomain.com/yourpaging.aspx?page=1**.


        My Website | Ask smart questions

        R 1 Reply Last reply
        0
        • A Abolfazl Sheikhloo

          tou can fetch data from database and store it in xml file before using in gridview or any control, then work with xml file for paging and sorting or ...

          We Can Do Anything, If We Want It

          N Offline
          N Offline
          N a v a n e e t h
          wrote on last edited by
          #4

          Abolfazl Sheikhloo wrote:

          tou can fetch data from database and store it in xml file before using in gridview

          What is the benefit of doing like this ? Assume 100 user accessing the page same time , will you create 100 XML files ?


          My Website | Ask smart questions

          A 1 Reply Last reply
          0
          • N N a v a n e e t h

            Abolfazl Sheikhloo wrote:

            tou can fetch data from database and store it in xml file before using in gridview

            What is the benefit of doing like this ? Assume 100 user accessing the page same time , will you create 100 XML files ?


            My Website | Ask smart questions

            A Offline
            A Offline
            Abolfazl Sheikhloo
            wrote on last edited by
            #5

            no no no. you can manage your xml file for all users. your xml is simulated from database table or view. for example your xml contains 20,000 record and you need to all records but the database view contains 2,000,000 record and you don't need to all records. working with 20,000 records is faster than working with 2,000,000 records We Can Do Anything, If We Want It

            1 Reply Last reply
            0
            • N N a v a n e e t h

              virendra_007 wrote:

              am implementing pagin in my project where I am showing around 10 recordset per page

              What control you are using to show the results ? Is it a datagrid/gridview ? Both supports paging. You can set allowpaging=true and set the pagesize. This method for paging implementation is very easy. But efficient way will be doing the manual paging. First you need to find the total page by **totalrecords/pagesizesize**. Then depending on the page number you need to fetch only 10 records(your page size) from the database for that page. So your page may look like this **www.yourdomain.com/yourpaging.aspx?page=1**.


              My Website | Ask smart questions

              R Offline
              R Offline
              rashadaliarshad
              wrote on last edited by
              #6

              http://www.yourdomain.com/yourpaging.aspx?page=1.[^] can u provide any examples for this method?

              :- Rashid Ali -:

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups