Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Where to store a dataset (confused of cache, session, viewstate)?

Posted on 2004-11-12
7
Medium Priority
?
1,035 Views
Last Modified: 2008-01-09
Hey created a .xsd (strongly typed) dataset.
User inserts to this ds info he likes -
lets say its an order entry form - so each user should see their data and only when they are in that page.

Currently i stored this dataset in CACHE object.
But is that the correct place to store it
(I think "OLD" Session Object would be too slow, but VIEWSTATE ?)

Suggestions and thoughts appreciated!
0
Comment
Question by:MargusLehiste
7 Comments
 
LVL 17

Expert Comment

by:AerosSaga
ID: 12576612
You can store the dataset in Session:

From Page1:

Session("PassedDS") = ds


From Page2:

Dim ds As DataSet = Session("PassedDS")

Aeros
0
 
LVL 28

Expert Comment

by:mmarinov
ID: 12579797
Hi MargusLehiste,

i think viewstate is a better choice if you want the dataset to be accessible only within this page, but take a look at these articles for state management:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconchoosingserverstateoption.asp
http://msdn.microsoft.com/library/en-us/vbcon/html/vbtskRetainingWebFormsPageValuesWithViewStateProperty.asp

Regards!
B..M
mmarinov
0
 
LVL 1

Author Comment

by:MargusLehiste
ID: 12581483
MMarinov - thank you for your reply,

so do you think that in my case I should replace Cache with viewstate ?

AerosSaga - as I understand Application and Session variables put unnecessary overhead to server.
In my case - you are correct the dataset must be private for each user - however - I do not require access to this dataset from another page.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 28

Assisted Solution

by:mmarinov
mmarinov earned 800 total points
ID: 12581559
MargusLehiste,

Yes i think so, because the viestate is on the client ( e.g. accessible only for the user and not overhead the server ) and it is active only for the current page

B..M
mmarinov
0
 
LVL 1

Accepted Solution

by:
khareatul earned 1000 total points
ID: 12643713
Atul:

Hi

you should store the Dataset in Session .but not in Cache because cache make a single copy of cache variable on the server,If unfortunatily two users access the page at the
same time then may be one can view the data entered by other because there will be only one cache variable on the server,and this cache object will be sharable.

If still you want to use Cache Object then make the cache object Unique by adding the SessionId like:

Cache["VariableName"+Session.SessionID] = AnyValue;


Because you also want that the dataset must be private for each user so you should only use the Session.

Regards
Atul Khare
0
 

Expert Comment

by:madhukartha
ID: 12760790
Hi ,

I also have a similar issue.In my case the dataset is bound to a grid with heavy data.
I have felt using Viewstate has made the page slow.Any suggestions please?

Thanks
Madhu
0
 
LVL 1

Author Comment

by:MargusLehiste
ID: 12767005
Madhu - I think cache is the best way to go.
Viewstate puts a heavy load on client, Session and Application objects are OLD - and therefore not very efficient.
Ive been using Cache["VariableName"+Session.SessionID] and its been pretty OK.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month10 days, 12 hours left to enroll

572 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