Cache is not work in ASP.NET

G

Goran

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

Guest

Hi Goran,

Seems compiler probably wasn't able to resolve the Cache type. use
HttpContext.Current.Cache.Insert instead.
 

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,772
Messages
2,569,593
Members
45,108
Latest member
AlbertEste
Top