Collection datatype question.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dmitrii PapaGerogio

    Collection datatype question.

    Right now I am using Vector to store two values...someth ing in the lines
    of...

    Vector v = new Vector();
    v.Add("bob", 21);
    v.Add("dan", 26);
    v.Add("sally", 24);

    but now using Vector which will only hold 2 values is not enough. Is
    there something in the MS collections package that can store more than 2
    values? Like...

    v.Add("bob", 21, "1211 SouthLane Dr.", "active");

    or do I need to create my own Collection class?
  • Miha Markic [MVP C#]

    #2
    Re: Collection datatype question.

    Hi Dmitrii,

    Why don't you create a class that stores your data and then just use
    ArrayList to store those classes.

    --
    Miha Markic [MVP C#] - RightHand .NET consulting & development
    miha at rthand com


    "Dmitrii PapaGerogio" <teddy@woh.rr.c omNOSPAM> wrote in message
    news:QoQyc.2306 0$ih7.4763@fe2. columbus.rr.com ...[color=blue]
    > Right now I am using Vector to store two values...someth ing in the lines
    > of...
    >
    > Vector v = new Vector();
    > v.Add("bob", 21);
    > v.Add("dan", 26);
    > v.Add("sally", 24);
    >
    > but now using Vector which will only hold 2 values is not enough. Is
    > there something in the MS collections package that can store more than 2
    > values? Like...
    >
    > v.Add("bob", 21, "1211 SouthLane Dr.", "active");
    >
    > or do I need to create my own Collection class?[/color]


    Comment

    • Kail

      #3
      Re: Collection datatype question.

      Hello,
      where did you find a Vector in C# - could you give me a name of namespace?
      i was looking for something similar to java.util.Vecto r in C#... but i
      haven't found.

      Adam

      Uzytkownik "Dmitrii PapaGerogio" <teddy@woh.rr.c omNOSPAM> napisal w
      wiadomosci news:QoQyc.2306 0$ih7.4763@fe2. columbus.rr.com ...[color=blue]
      > Right now I am using Vector to store two values...someth ing in the lines
      > of...
      >
      > Vector v = new Vector();
      > v.Add("bob", 21);
      > v.Add("dan", 26);
      > v.Add("sally", 24);
      >
      > but now using Vector which will only hold 2 values is not enough. Is
      > there something in the MS collections package that can store more than 2
      > values? Like...
      >
      > v.Add("bob", 21, "1211 SouthLane Dr.", "active");
      >
      > or do I need to create my own Collection class?[/color]


      Comment

      • Dmitrii PapaGerogio

        #4
        Re: Collection datatype question.

        Kail wrote:[color=blue]
        > Hello,
        > where did you find a Vector in C# - could you give me a name of namespace?
        > i was looking for something similar to java.util.Vecto r in C#... but i
        > haven't found.
        >
        > Adam
        >
        > Uzytkownik "Dmitrii PapaGerogio" <teddy@woh.rr.c omNOSPAM> napisal w
        > wiadomosci news:QoQyc.2306 0$ih7.4763@fe2. columbus.rr.com ...
        >[color=green]
        >>Right now I am using Vector to store two values...someth ing in the lines
        >>of...
        >>
        >>Vector v = new Vector();
        >>v.Add("bob" , 21);
        >>v.Add("dan" , 26);
        >>v.Add("sally" , 24);
        >>
        >>but now using Vector which will only hold 2 values is not enough. Is
        >>there something in the MS collections package that can store more than 2
        >>values? Like...
        >>
        >>v.Add("bob" , 21, "1211 SouthLane Dr.", "active");
        >>
        >>or do I need to create my own Collection class?[/color]
        >
        >
        >[/color]
        it's in the Collection namespace

        Comment

        Working...