Solved

storing datatable in session

Posted on 2011-02-17
5
379 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:HainKurt
HainKurt 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

822 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