Hi Mark,
Welcome. I've also followup in your former thread
"ASP.NET 2.0: Global.asax Design Surface Gone",
As I've mentioned, there what's the code raise the problem when you
accessing ApplicationState? ApplicationState is absolute a application
scope variable which is visible to all pages and requests..... Also,
ASP.NET application Cache, Class's Static member are all possible approach
for storing application scope data.....
In addition, as for Caching the data retrieved from backend database, I
don't quite recommend using DataReader because Datareader will hold a
opened connection to the backend database until we call Close() to dispose
the DataReader, see the below msdn remark:
=========================
While the SqlDataReader is being used, the associated SqlConnection is busy
serving the SqlDataReader, and no other operations can be performed on the
SqlConnection other than closing it. This is the case until the Close
method of the SqlDataReader is called. For example, you cannot retrieve
output parameters until after you call Close
=========================
So using a DataSet (typed or not) or a custom object class collection to
hold such cached data is prefered....
Thanks,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| NNTP-Posting-Date: Fri, 23 Dec 2005 14:17:03 -0600
| From: Mark Olbert <
[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Subject: Application-wide
| Date: Fri, 23 Dec 2005 12:17:01 -0800
| Organization: Olbert & McHugh, LLC
| Reply-To: (e-mail address removed)
| Message-ID: <
[email protected]>
| X-Newsreader: Forte Agent 3.1/32.783
| MIME-Version: 1.0
| Content-Type: text/plain; charset=us-ascii
| Content-Transfer-Encoding: 7bit
| Lines: 11
| X-Trace:
sv3-9BJVUyvbHIFaHGSfEY1hANOCWH0wWrX0lxFQn+j7zORB3cy1txUMt9Y0zCPC3V+SK9a8k4Hl
2R0xXAt!kNpTqtiAJS0Ln0GHEhsQncn06s9eP0EqxUAN992y0qM03iE+I9MF13rzghIfaioDO93s
fQ==
| X-Complaints-To: (e-mail address removed)
| X-DMCA-Notifications:
http://www.giganews.com/info/dmca.html
| X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
| X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your
complaint properly
| X-Postfilter: 1.3.32
| Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli
ne.de!border2.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.gigan
ews.com!local01.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:366854
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| I want to bind a series of ObjectDataSource instances to an
application-wide business object which caches the results of a database
| query.
|
| I'm confused about where/how to cache the results (it's a simple query,
BTW, so I'm using a DataReader, not a DataTable). The
| business object has no knowledge of the application, and hence of the
Cache, which is where I would normally put this kind of thing
| (actually, I used to put this stuff in global.asax.cs...but since MS in
its infinite wisdom has radically redesigned ASP.NET 2, this
| is no longer an option).
|
| Suggestions?
|
| - Mark
|