Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple collection example?

Status
Not open for further replies.

rrhandle

Programmer
Joined
Dec 26, 2001
Messages
193
Location
US
Can anyone point me to a simple example for creating a collection class that is serializable written in vb.net?

The only thing worse than being alone, is wishing you were.
 
I should have asked the question differently. The real problem is how do I create a single instance of the collection class, and keep it alive. In VB6, I did this by creating the single instance when the application started up, but I am confused about how this is done in ASP.NET. I just want to create one instance of the collection class and stick it into a session variable so I can keep it alive during the users session.

Thanks

The only thing worse than being alone, is wishing you were.
 
To create a collection, you would simply use:
Code:
Dim MyCollection as New Collection
Then, to store it in a session, just use:
Code:
Session.Add("MySessionCollection", MyCollection)
And to retreive it:
Code:
RetreivedCollection = CType(Session("MySessionCollection"), Collection)


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top