locked
ArrayList namespace not found - c# express RRS feed

  • Question

  • Hi,

    I am trying to learn c#. I was working on a small program, and I needed to use an arraylist. When I type ArrayList myArray = new ArrayList();, an error message is generated saying that "The type or namespace "ArrayList" could not be found (Are you  missing a directive or an assembly reference?)" I don't know how to fix this error. I reinstall c#, but I am getting the same error. I am using a Compaq Presario 2100 - Mobile Intel(r) Celeron(R)  2GHz and 128 mb of ram - window xp pro -2002 /sp2. Any kind of help would be appreciated.

    Saturday, August 26, 2006 3:54 PM

Answers

  • you need to import the System.Collections namespace
    Saturday, August 26, 2006 8:39 PM

All replies

  • goto the help section - f1, type in arraylist. You will find that ArrayList is a member of System.Collections if you poke around enough.  so put using System.Collections at the top of your program listing, or whatever its called ;-)

     

    Best Wishes, Ray

    Saturday, August 26, 2006 4:28 PM
  • Thank you Ray. I tried f1, but I wasn't getting any result. However, I did manage to find it on google. Thank you so much
    Saturday, August 26, 2006 5:09 PM
  • you need to import the System.Collections namespace
    Saturday, August 26, 2006 8:39 PM