M macky caliston Jul 11, 2008 #1 Hi, How can I convert hashtable.Values to an ArrayList? Thanks a Lot, Macky
G Göran Andersson Jul 11, 2008 #2 macky said: Hi, How can I convert hashtable.Values to an ArrayList? Thanks a Lot, Macky Click to expand... You can't. You can create a new ArrayList and copy the items from the collection to it: ArrayList newList = new ArrayList(someHashTable.Values); Unless you are stuck with framework 1.x, I suggest that you use generic lists and dictionaries instead of ArrayList and HashTable.
macky said: Hi, How can I convert hashtable.Values to an ArrayList? Thanks a Lot, Macky Click to expand... You can't. You can create a new ArrayList and copy the items from the collection to it: ArrayList newList = new ArrayList(someHashTable.Values); Unless you are stuck with framework 1.x, I suggest that you use generic lists and dictionaries instead of ArrayList and HashTable.
A Arne Vajhøj Jul 11, 2008 #3 macky said: How can I convert hashtable.Values to an ArrayList? Click to expand... Try: new ArrayList(ht.Values) Arne
macky said: How can I convert hashtable.Values to an ArrayList? Click to expand... Try: new ArrayList(ht.Values) Arne