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
  1. Home
  2. Web Development
  3. ASP.NET
  4. DataTables as Session object issues?

DataTables as Session object issues?

Scheduled Pinned Locked Moved ASP.NET
databaseperformancequestionlearning
7 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.
  • M Offline
    M Offline
    MaxRelaxman
    wrote on last edited by
    #1

    Besides memory consumption, are there any issues I should be aware of when keeping DataTables in a session object? Here's my situation: When a user adds a new entry into the database, there are of course a pile of related child tables that have to be filled in as well. When working with a new record, there won't be an valid ID for the parent record so I'm doing everything in memory until the user hits 'save'. I've already got a couple of my GridViews working fine but I was wondering if there where any gotcha's. Thanks!

    L P C 3 Replies Last reply
    0
    • M MaxRelaxman

      Besides memory consumption, are there any issues I should be aware of when keeping DataTables in a session object? Here's my situation: When a user adds a new entry into the database, there are of course a pile of related child tables that have to be filled in as well. When working with a new record, there won't be an valid ID for the parent record so I'm doing everything in memory until the user hits 'save'. I've already got a couple of my GridViews working fine but I was wondering if there where any gotcha's. Thanks!

      L Offline
      L Offline
      Laddie
      wrote on last edited by
      #2

      My 1 cent to this 1) May be you can try using a staging table in db to store this temporay values and when the user hits save; copy from staging to the main table. 2) Or Create a view state object and add the data table to it.

      Thanks Laddie Kindly rate if the answer was helpful

      M 1 Reply Last reply
      0
      • L Laddie

        My 1 cent to this 1) May be you can try using a staging table in db to store this temporay values and when the user hits save; copy from staging to the main table. 2) Or Create a view state object and add the data table to it.

        Thanks Laddie Kindly rate if the answer was helpful

        M Offline
        M Offline
        MaxRelaxman
        wrote on last edited by
        #3
        1. So have a set of duplicate temp tables in the database? Maybe use the user's id as the record IDs. 2) Question, why would you use view state over session objects? I guess the view state would save memory on the server but it wouldn't the increased page size slow down the user's browser? I guess using AJAX update panels would help with that. Thanks for your response!
        L 1 Reply Last reply
        0
        • M MaxRelaxman
          1. So have a set of duplicate temp tables in the database? Maybe use the user's id as the record IDs. 2) Question, why would you use view state over session objects? I guess the view state would save memory on the server but it wouldn't the increased page size slow down the user's browser? I guess using AJAX update panels would help with that. Thanks for your response!
          L Offline
          L Offline
          Laddie
          wrote on last edited by
          #4
          1. Ya, UserID,Session ID cound serve as he primary key and when the user clicks save copy and insert to the main table and delete the same from temp table. 2) a) The good thing of View sate over the session variables is that you can dispose then once done with it. b) Update panel does nothing more than hiding the user from seeing a full page refresh by interepting post back.Behind the Scenes it does everything that needs to be done with out its presence.

          Thanks Laddie Kindly rate if the answer was helpful

          1 Reply Last reply
          0
          • M MaxRelaxman

            Besides memory consumption, are there any issues I should be aware of when keeping DataTables in a session object? Here's my situation: When a user adds a new entry into the database, there are of course a pile of related child tables that have to be filled in as well. When working with a new record, there won't be an valid ID for the parent record so I'm doing everything in memory until the user hits 'save'. I've already got a couple of my GridViews working fine but I was wondering if there where any gotcha's. Thanks!

            P Offline
            P Offline
            Pramirez
            wrote on last edited by
            #5

            Hi, what I do in those cases, is set the related column in the child table as not required(allow nulls), then I save the parent data and I get the new ID, with that new ID I will fill all the child tables and then I save them.

            Geek to the bone.

            1 Reply Last reply
            0
            • M MaxRelaxman

              Besides memory consumption, are there any issues I should be aware of when keeping DataTables in a session object? Here's my situation: When a user adds a new entry into the database, there are of course a pile of related child tables that have to be filled in as well. When working with a new record, there won't be an valid ID for the parent record so I'm doing everything in memory until the user hits 'save'. I've already got a couple of my GridViews working fine but I was wondering if there where any gotcha's. Thanks!

              C Offline
              C Offline
              ChrisKo 0
              wrote on last edited by
              #6

              Create a custom class that's stored in Session with it's own Save() method that will write to the DB. The DataTable probably has more information than you need and will waste more memory by storing it in Session. You can bind all your GridViews to the class just as easy.

              M 1 Reply Last reply
              0
              • C ChrisKo 0

                Create a custom class that's stored in Session with it's own Save() method that will write to the DB. The DataTable probably has more information than you need and will waste more memory by storing it in Session. You can bind all your GridViews to the class just as easy.

                M Offline
                M Offline
                MaxRelaxman
                wrote on last edited by
                #7

                That seems like the best solution. Use an array to hold the data and built an interface around it. Thanks!

                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