Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 271
  • Last Modified:

collection class of vb6 in .net?


Is there a replacement of the collection class in .net? any reference?

Thanks!
0
ChenChen
Asked:
ChenChen
1 Solution
 
acharbonneauCommented:
You could use a HashTable.
It's located in the System.Collections namespace.
Alternatively, there is the ArrayList from the same namespace.
0
 
arif_eqbalCommented:
There are quite a few alternatives as mentioned above
but it would depend exactly on
Why you want a replacement ??
What extra features you want ??

0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
The old Collection class from VB6 is still in VB.Net and you can use it in exactly the same way as you did before:

    Dim c As New Collection
    c.Add("value", "key")

I agree with arif_eqbal...if you need a replacement, then what are your requirements.  None of the collection classes that come with .Net work quite like the Collection class did:

    The Collection class allows you to retrieve by Index or Key.
    The ArrayList only allows access by Index.
    The HashTable and SortedList only allow access by Key.

~IM
0
 
arif_eqbalCommented:
Hi, Idle_Mind

Even I was tempted earlier to tell him that the Collection Class is still available and pretty much the same

But when I re-read his question I thought he knows its there but does not want to use them. That's why I wanted to know WHY, What extra he wants

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now