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?
 

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

Back
Top