Store collection in Application Object

G

Geert M

Is it possible to store collections of my custom defined object in an
application state variable.
How can this be done?
 
B

Bill Priess

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.
 
G

Geert M

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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top