PC Review


Reply
Thread Tools Rate Thread

Cache is not work in ASP.NET

 
 
Goran
Guest
Posts: n/a
 
      6th Feb 2007
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


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

 
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
Re: DNS cache doesn't work after SP3 install smlunatick Windows XP Help 0 27th Apr 2009 09:04 PM
Autocomplete cache do not work MRS Admin Microsoft Outlook Discussion 0 4th Mar 2009 12:33 PM
Client certificate / SSL Cache - how exactly does it work? jonathan.r.anderson@gmail.com Windows XP Internet Explorer 2 28th Aug 2006 08:06 PM
Smart Client - Cache does not work ?! Markus Microsoft Dot NET Framework Forms 0 30th May 2005 04:38 PM
cache (VaryByParam) doesn't work Dmitry Duginov Microsoft ASP .NET 7 29th Nov 2004 01:37 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:10 PM.