Hashtable.Item

  • Thread starter Thread starter Peter Kirk
  • Start date Start date
Peter Kirk said:
I obviously do not understand something about Hashtable....

The documentation in MSDN
http://msdn.microsoft.com/library/d...fsystemcollectionshashtableclassitemtopic.asp
states that there is a property called "Item".

But I get a compile time error when I try to use this property.
(System.Collections.Hashtable does not contain a definition for Item).

What am I missing?

Just as soon as I posted I realised what the reference to "indexer" meant in
the documentation. It's that odd (to me) way c# can reference collections

So I use it like this:
myHashTable[myKey]

Peter
 
Hi Peter,

As far as I can tell, 'Item' should work and be available. Maybe you are
missing a reference?
Do you have :

using System.Collections;

in your code? If so, please post some sample code.

HTH
Christiaan
 
Back
Top