Store collection in Application Object

  • Thread starter Thread starter Geert M
  • Start date Start date
G

Geert M

Is it possible to store collections of my custom defined object in an
application state variable.
How can this be done?
 
While it is possible, it is not recommended. The way to do it is

C#:
Application["variable name"] = obj;
//or//
Application.Add("variable name", obj);

VB:
Application("variable name") = obj
'or'
Application.Add("variable name", obj)

But, you should think about using Cache or persistence for storing your
collections.

HTH,
Bill P.
 
Could you give an example of what you mean with persistence?

Bill Priess said:
While it is possible, it is not recommended. The way to do it is

C#:
Application["variable name"] = obj;
//or//
Application.Add("variable name", obj);

VB:
Application("variable name") = obj
'or'
Application.Add("variable name", obj)

But, you should think about using Cache or persistence for storing your
collections.

HTH,
Bill P.
Geert M said:
Is it possible to store collections of my custom defined object in an
application state variable.
How can this be done?
 
Back
Top