PC Review


Reply
Thread Tools Rate Thread

best way to keep persistence of a dataset?

 
 
=?Utf-8?B?cGF0cmlja2RyZA==?=
Guest
Posts: n/a
 
      1st Feb 2007
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!
 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      1st Feb 2007

not viewstate. use session or recreate from database.

-- bruce (sqlwork.com)



patrickdrd wrote:
> 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!

 
Reply With Quote
 
=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
Guest
Posts: n/a
 
      1st Feb 2007
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

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net




"patrickdrd" wrote:

> 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!

 
Reply With Quote
 
MasterGaurav \(www.edujini-labs.com\)
Guest
Posts: n/a
 
      1st Feb 2007
> 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
-----------------------------------------


 
Reply With Quote
 
=?Utf-8?B?cGF0cmlja2RyZA==?=
Guest
Posts: n/a
 
      1st Feb 2007
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?

"MasterGaurav (www.edujini-labs.com)" wrote:

> > 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
> -----------------------------------------
>
>
>

 
Reply With Quote
 
MasterGaurav \(www.edujini-labs.com\)
Guest
Posts: n/a
 
      7th Feb 2007
>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
-----------------------------------------


 
Reply With Quote
 
=?Utf-8?B?cGF0cmlja2RyZA==?=
Guest
Posts: n/a
 
      7th Feb 2007
"MasterGaurav (www.edujini-labs.com)" wrote:

> 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...
 
Reply With Quote
 
MasterGaurav \(www.edujini-labs.com\)
Guest
Posts: n/a
 
      1st Mar 2007
> 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
-----------------------------------------


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dataset persistence within a web form MattB Microsoft ASP .NET 6 18th Mar 2004 01:37 PM
Dataset persistence =?Utf-8?B?SG9seXNtb2tl?= Microsoft ADO .NET 1 3rd Mar 2004 04:27 PM
Dataset persistence??? Jason Microsoft ASP .NET 5 27th Oct 2003 06:51 PM
Persistence Ralph Lund Microsoft C# .NET 2 9th Oct 2003 03:50 PM
Persistence in .Net Sergei Gnezdov Microsoft Dot NET 0 29th Jul 2003 12:00 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:55 AM.