Collections

  • Thread starter Thread starter Guest
  • Start date Start date
Aadam,

You will want to use the ArrayList class in the System.Collections
namespace. It will allow you to access items in the order you add them.

If you need the ability to look up a value using a key, then use the
Hashtable class in the System.Collections namespace.

In .NET 2.0, you should use the List<T> and the Dictionary<K, V> types
respectively (they are generic, with T, K, and V being type parameters).

Hope this helps.
 
Adam,

As an addition on the answer from Nick
How do you do a VB.NET type Collection in C#?

Although there is no problem to use the Microsoft.VisualBasic "Collection"
in C#, than is that the last thing I would do. I don't even use that one in
VBNet and don't understand why it is not placed in the Microsoft.VisualBasic
compatible namespace because of its absolute diverge starting First indexer
comparing to all other collections.

Therefore, take the advise from Nick (even in VBNet).

Cor
 
Back
Top