Solved

storing datatable in session

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now