best way to keep persistence of a dataset?

G

Guest

Hi everyone?

Which is considered to be the 'best' way to cache a dataset and/or a crystal
reports reportdocument object?
ViewState? Session? Something else?

Thanks in advance!
 
B

bruce barker

not viewstate. use session or recreate from database.

-- bruce (sqlwork.com)
 
G

Guest

If the report is user session specific, store it in Session State. If it is
application - wide (for any user) store it in Cache or Application State. I'm
not sure if a Crystal Reports "ReportDocument" object is serializable, but if
it is, you could consider storing that in either Session or Cache with the
same criteria applying.
ViewState only stores objects between postbacks of the same page, and it is
grossly misused by developers and should be avoided.
Peter
 
M

MasterGaurav \(www.edujini-labs.com\)

ViewState only stores objects between postbacks of the same page, and it
is
grossly misused by developers and should be avoided.

Even if you want to save the DataSet only across pages, still use Session to
store on server and not pass it in ViewState everytime.

And then, how to manage it... it's simple.


--
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujini-labs.com
http://eduzine.edujini-labs.com
-----------------------------------------
 
G

Guest

I just used ViewState because it is to be used only on one specific page,
but I'll try your recommendations and I'll try to store it in Session and
recreation from db and I'll check the time it does,
but:
1) what about variables that are to be used on one specific page only?
Should I store these in Session too?
2) Where should ViewState be used? Or shouldn't it be used in general?
 
M

MasterGaurav \(www.edujini-labs.com\)

I just used ViewState because it is to be used only on one specific page,
but I'll try your recommendations and I'll try to store it in Session and
recreation from db and I'll check the time it does,
but:
1) what about variables that are to be used on one specific page only?
Should I store these in Session too?

No. Only and only in ViewState. Because that's the one meant for the pages.
2) Where should ViewState be used? Or shouldn't it be used in general?

Use it but with a care since the data is sent to the client side.
a) Don't store sensitive information.
b) Don't overload it. It's a burden on the network (bandwidth).

btw, why don't you have a look at Ajax (using Ajax.Net or otherwise) for
simple pages? I don't really know what your application is... but may be it
can be of help.


--
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujini-labs.com
http://eduzine.edujini-labs.com
-----------------------------------------
 
G

Guest

MasterGaurav (www.edujini-labs.com) said:
btw, why don't you have a look at Ajax (using Ajax.Net or otherwise) for
simple pages? I don't really know what your application is... but may be it
can be of help.

I use Ajax already but this app I had in mind when I posted this is a
Crystal Report app and I don't think I could avoid the postback.
What I would like to store is a dataset that very rarely changes.
I used ViewState and it was quite slow,
tried Cache a bit but seemed a bit awkward to me,
maybe I'll try to recreate the dataset in each postback,
as someone suggested here...
 
M

MasterGaurav \(www.edujini-labs.com\)

I use Ajax already but this app I had in mind when I posted this is a
Crystal Report app and I don't think I could avoid the postback.

Not quite sure... need to look into what exactly you are doing.

UpdatePanel in Ajax.Net allows converting existing post-backs to ajax-based
requests.


--
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujini-labs.com
http://eduzine.edujini-labs.com
-----------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top