cache question

  • Thread starter Thread starter Aaron
  • Start date Start date
A

Aaron

Is it possible to store a string into cache?
It seems that only datatables/dataset can be stored in cache from the
examples on MSDN and the internet. I tried changing it to a string and
retriving it but it says null reference error or something like that.
this is what i did
---------
cache.insert(e.GetUser, e.GetSignature);

cache[e.GetUser].ToString;

----------
If it is possible to store a string in cache, can someone provide me
with an example?



thanks

Aaron
 
Aaron said:
Is it possible to store a string into cache?
Yes.

[snip]
cache.insert(e.GetUser, e.GetSignature);

cache[e.GetUser].ToString;
If it is possible to store a string in cache, can someone provide me
with an example?

Cache.Insert("foo", "bar");
string s = (string)Cache["foo"];
 
Back
Top