How do I maintain dataset across page postback without session ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anoop s
    New Member
    • Feb 2011
    • 16

    How do I maintain dataset across page postback without session ?

    Hi,

    In my application I need to display reports in datagrid, But need to display only 10 records at a time. I implemented paging by using session. I know it is not a good practice. Some sites suggested to fetch the only records that needed to display. But the problem It is very complicated procedure and will take much more time to run the procedure. How can I avoid the use of Session for storing the heavy ado object. How can I maintain the dataset in the page refresh.
    Thanks in advance.

    Anoop.
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    There's nothing wrong with storing your data in session or even in ASP.NET's cache.... it's expensive to be making database calls all the time.

    I use session or cache all the time to store my data.
    When I need paging, the control that I store in session/cache is a DataView. I use this as the source for my GridView.

    -Frinny

    Comment

    • anoop s
      New Member
      • Feb 2011
      • 16

      #3
      Thanks Frinny for your immediate response. But it affects the performance of my application while a number of users are online. Can I clear the particular dataset from session when the page is no more using.

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        Yes you can!
        What's stopping you from doing it?

        If the data sets can be used by more than one person you can use ASP.NET cache instead....this is accessible to all users.

        Comment

        Working...