Solved

storing datatable in session

Posted on 2011-02-17
5
382 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
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 51

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Open dialog with server side controls in it 3 46
Why use this lambda? 12 60
asp.net figure out error 3 20
Build a string of emails from a gridview 2 13
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

713 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