collection class of vb6 in .net?

Posted on 2004-11-17
Last Modified: 2010-04-24

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

Question by:ChenChen
    LVL 2

    Expert Comment

    LVL 2

    Expert Comment

    You could use a HashTable.
    It's located in the System.Collections namespace.
    Alternatively, there is the ArrayList from the same namespace.
    LVL 19

    Expert Comment

    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 ??

    LVL 85

    Accepted Solution

    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.

    LVL 19

    Expert Comment

    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


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Suggested Solutions

    A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
    1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now