Solved

storing datatable in session

Posted on 2011-02-17
5
386 Views
Last Modified: 2012-05-11
I need to be able to retrieve my shopping cart information in another page to print the info. So I am storing it in session as:

Session("cart") = datagrid1.datasource

Is there any downside to storing this in session?
Since this is shopping cart, I am thinking maximumum number of records cant be too high. Please suggest if there is any adv / disadv to storing this in session. Thanks
0
Comment
Question by:TrialUser
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 16

Accepted Solution

by:
Kalpesh Chhatrala earned 100 total points
ID: 34923224
0
 
LVL 10

Assisted Solution

by:himanshut
himanshut earned 100 total points
ID: 34923229
Well, by using sessions you'll definitely be able to access the values over the different pages.
But the only disadvantage can be if you don't clear out the sessions once they have been consumed by the application, it can be a security risk and overload to your application memory.

0
 
LVL 39

Assisted Solution

by:Pratima Pharande
Pratima Pharande earned 100 total points
ID: 34923407
0
 
LVL 55

Assisted Solution

by:Huseyin KAHRAMAN
Huseyin KAHRAMAN earned 100 total points
ID: 34923457
I say session... if you use db to store sessions it is better, so you can use web farm...
cart items cannot create security issue... if they login, you can store them into db and clear the session if you want... so after they login again, they can continue their cart... before login, it will be in session... when user closes the browser without emptying cart, it will be cleared after session timeout reaches (20 min by default)

using cookies, writing to temp files, using viewstate, form variables, query strings.... just more headache...
0
 
LVL 11

Assisted Solution

by:SAMIR BHOGAYTA
SAMIR BHOGAYTA earned 100 total points
ID: 34924559
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question