Advertisement

04.10.2008 at 09:24AM PDT, ID: 23312384
[x]
Attachment Details

System.Web.Caching.Cache Error - Object not set to an instance of an object???

Asked by kalliopi in Microsoft Visual C#.Net, .Net Editors & IDEs, .NET Framework 3.x versions

HI,

I have the following 3 lines of code.  On line 2, I get the error Object reference not set to an instance of an object.  So, I create the cache, try to add something too it - and get the error.

What am I doing wrong?

ej
Start Free Trial
1:
2:
3:
Cache c = new Cache();
            c.Add("test", "test", null, Cache.NoAbsoluteExpiration, new TimeSpan(0, 5, 0), CacheItemPriority.Normal, null);
            if (c["test"] == null) Response.Write("Null");
[+][-]04.10.2008 at 12:06PM PDT, ID: 21328242

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.10.2008 at 01:41PM PDT, ID: 21329160

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.10.2008 at 03:55PM PDT, ID: 21330105

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.12.2008 at 01:05PM PDT, ID: 21342308

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.12.2008 at 08:30PM PDT, ID: 21343457

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual C#.Net, .Net Editors & IDEs, .NET Framework 3.x versions
Sign Up Now!
Solution Provided By: apeter
Participating Experts: 1
Solution Grade: A
 
 
[+][-]04.13.2008 at 12:20AM PDT, ID: 21343951

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_EXPERT_20070906