473,399 Members | 3,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Cache is not work in ASP.NET

I have some code which put DataSet in Cache. But I have run time error
"Cache is not available". This is my code:

dsObject = Cache("Translate")
If dsObject Is Nothing Then
odbConn = New
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; data source=" & Putanja)

SQL = "SELECT * FROM Translate_text WHERE ID='" & Word & "'"

odbAdapt = New OleDbDataAdapter(SQL, odbConn)
dsObject = New DataSet
odbAdapt.Fill(dsObject)
Cache.Insert("Translate", dsObject)
End If
dtObject = dsObject.Tables(0)

How to fix this problem? Do I need to change something in Windows or IIS or
mybe I need to write some aditional code?

--
FREE Anonymus SMS:
http://theSMSzone.com/?ref=Mertojak
Feb 6 '07 #1
1 1136
Hi Goran,

Seems compiler probably wasn't able to resolve the Cache type. use
HttpContext.Current.Cache.Insert instead.
--
Milosz
"Goran" wrote:
I have some code which put DataSet in Cache. But I have run time error
"Cache is not available". This is my code:

dsObject = Cache("Translate")
If dsObject Is Nothing Then
odbConn = New
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; data source=" & Putanja)

SQL = "SELECT * FROM Translate_text WHERE ID='" & Word & "'"

odbAdapt = New OleDbDataAdapter(SQL, odbConn)
dsObject = New DataSet
odbAdapt.Fill(dsObject)
Cache.Insert("Translate", dsObject)
End If
dtObject = dsObject.Tables(0)

How to fix this problem? Do I need to change something in Windows or IIS or
mybe I need to write some aditional code?

--
FREE Anonymus SMS:
http://theSMSzone.com/?ref=Mertojak
Feb 6 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Promenade | last post by:
Hi, everyone... I want to avoid the user to use the navigator back button. For that reason, I tried all the possible ways to set the Expires property of the Response Object, but whatever I do, it...
2
by: Kikoz | last post by:
Hi all. I keep my ViewState in server's cache. Works fine except when user leaves the page opened for a long time (2 hours or so). Then if he/she tries to post it back the server throws an...
2
by: junlia | last post by:
Hi All, I am working on a project that acts as a bridge. It does some checking with post xml data, and then redirects the request to an appropriate page. However, we find that depends on the...
0
by: mateipuiu | last post by:
When a try to run a client build on 2005, which uses the Microsoft.ApplicationBlocks.Cache.dll reference, when using a Microsoft.ApplicationBlocks.Cache.dll created on Debug mode, the client works...
11
by: EagleRed | last post by:
I am writing an ASP.NET 2.0 application that uses master pages. I have some pages that must not be cached on the client. In ASP.NET 1.1 I achieved this using metatags: <meta...
17
by: StevePBurgess | last post by:
A really simple script is driving me up the wall. I have a very simply facility on a website to allow the user to reorder items in a database table as she wishes by clicking a link that (in this...
5
by: Stan SR | last post by:
Hi, Some newbie questions.. :-) First, what is the namespace to use for the Cache class ? When I use this bit of code I get an error if (Cache==null) Cache.Insert("myUserList",userlist);...
0
by: =?Utf-8?B?YmlqYXk=?= | last post by:
The type initializer for 'Microsoft.ApplicationBlocks.Cache.CacheService' threw an exception. We migrated our windows application from 1.1 to 2.0. The debug and Release mode of the application...
2
by: moondaddy | last post by:
I had to repost this because I had to update and change my msdn alias. I will re-ask the question and clarify a few things that were not clear before. This code is all executed on my dev...
5
by: J055 | last post by:
Hi The following code works on my develeopment machine using the VS web server. When I run the application on 2 other Windows 2003/IIS 6 servers no caching seems to take place at all. Can...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.