PC Review


Reply
Thread Tools Rate Thread

converting hashtable.values to arrayList

 
 
macky caliston
Guest
Posts: n/a
 
      11th Jul 2008
Hi,

How can I convert hashtable.Values to an ArrayList?

Thanks a Lot,

Macky
 
Reply With Quote
 
 
 
 
Göran Andersson
Guest
Posts: n/a
 
      11th Jul 2008
macky caliston wrote:
> Hi,
>
> How can I convert hashtable.Values to an ArrayList?
>
> Thanks a Lot,
>
> Macky


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.

--
Göran Andersson
_____
http://www.guffa.com
 
Reply With Quote
 
Arne Vajhřj
Guest
Posts: n/a
 
      11th Jul 2008
macky caliston wrote:
> How can I convert hashtable.Values to an ArrayList?


Try:

new ArrayList(ht.Values)

Arne
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hashtable with ArrayList for value Slickuser Microsoft C# .NET 3 2nd Oct 2008 02:32 AM
Why ArrayList, not Hashtable Bruce Microsoft Dot NET 5 8th Jul 2007 03:40 PM
converting hashtable to arraylist Alexander Widera Microsoft ASP .NET 1 18th Jul 2005 10:52 AM
listbox bound to arraylist no changing values when values in arraylist are added or deleted Dave Microsoft VB .NET 0 11th Jan 2005 02:48 PM
ArrayList in Hashtable Matthias Kwiedor Microsoft C# .NET 3 24th Jun 2004 10:35 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:48 AM.