473,320 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Hashtable.Item

Hi

I obviously do not understand something about Hashtable....

The documentation in MSDN
http://msdn.microsoft.com/library/de...sitemtopic.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?

Thanks,
Peter
Nov 17 '05 #1
2 1733

"Peter Kirk" <pk@alpha-solutions.dk> skrev i en meddelelse
news:uX**************@TK2MSFTNGP15.phx.gbl...
I obviously do not understand something about Hashtable....

The documentation in MSDN
http://msdn.microsoft.com/library/de...sitemtopic.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
Nov 17 '05 #2
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

"Peter Kirk" <pk@alpha-solutions.dk> schreef in bericht
news:uX**************@TK2MSFTNGP15.phx.gbl...
Hi

I obviously do not understand something about Hashtable....

The documentation in MSDN
http://msdn.microsoft.com/library/de...sitemtopic.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?

Thanks,
Peter

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Anony | last post by:
Hi All, I used the Hashtable.Item in VB.Net, i.e. Dim Tables As New Hashtable Tables.Item(ID) = objTable Now, I tried the same in C#, and got an error says the Hashtable has no Item...
3
by: Frank | last post by:
Hi! I'm kinda stuck here. I have an Hashtable with with my custom "Item" Object. The key used in the Hashtable is the "Item.Id", i have selected this key because with a lot of functions i can...
9
by: Oberon | last post by:
My HashTable (Global.Games) is a static collection of objects of type Game. A Game object has 8 fields (exposed as properties). The key to the HashTable is also one of these fields (GameID, of type...
5
by: Victor Paraschiv | last post by:
I need to serialize into an XML file a hashtable. From MSDN at XmlSerializer:...
11
by: Crirus | last post by:
Easyest and fastest way... :) -- Ceers, Crirus ------------------------------ If work were a good thing, the boss would take it all from you ------------------------------
8
by: Robin Tucker | last post by:
When I create a hashtable hashing on Object-->Item, can I mix "string" and "integer" as the key types? I have a single thumbnail cache for a database with (hashed on key) and a file view (hashed...
5
by: Dick | last post by:
Hello, I'm trying to serialize a class with a Hashtable within: ' Class code: Imports System.Collections Class clsOptions Public countID As Integer Public persons As New Hashtable End Class
7
by: J L | last post by:
I have defined a structure private structure FieldInfo dim FieldName as string dim OrdinalPostioin as Integer dim DataType as Type dim Size as Integer end structure I read this information...
17
by: John A Grandy | last post by:
For a Hashtable that is expected to contain no more than 100 DictionaryEntry elements , what is the best load factor ? ( This Hashtable is a encapsulted in a class , an instance of which is...
2
by: PAzevedo | last post by:
I have this Hashtable of Hashtables, and I'm accessing this object from multiple threads, now the Hashtable object is thread safe for reading, but not for writing, so I lock the object every time I...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.