473,320 Members | 1,945 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.

Can not reference "item" property of HashTable

i declare a hashtable in c#, i can not find "hashtable.item" property
as the specification declared, What i can do?

B.Rgds
Nov 15 '05 #1
1 3416
Thomas Wang <tm******@ctsfreight.com> wrote:
i declare a hashtable in c#, i can not find "hashtable.item" property
as the specification declared, What i can do?


It's an indexer - you need to use the indexer syntax:

Hashtable foo = new Hashtable();

foo["hello"]="there"; // Effectively foo.set_Item("hello", "there")
Console.WriteLine (foo["hello"]); // Using foo.get_Item("hello")

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
Nov 15 '05 #2

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

Similar topics

3
by: Drulli Rokk | last post by:
Hi, Here's a question that has cost this newbie two days of headache already: How can I get my XSLT stylesheet to specify a maximum number of elements to process? I'm now using <xsl:for-each>...
1
by: lawrence | last post by:
I can't get this page to show in Internet Explorer, so I assume the error is quite grave. I'm using a PHP script to write the RSS file. In Netscape the page shows up as plain text. "Item" is...
3
by: Marc L'Ecuyer | last post by:
Hi, I have a collection class derived from CollectionBase. This collection can add items of my class MyItem. In my class MyItem, I have a Selected property. When this property is set to true, I...
5
by: Add and Paste | last post by:
Dear Access developers, I have a lot of cut and pasting to do from Excel to an Access form. But instead of just pasting, I want to "add then paste" the value. Does anybody have a way to do this?...
1
by: Mark Sanders | last post by:
I am wanting to create my own "Item" for use in the "File|Add New Item" dialog window. Does anyone know of any resources which would point me in the right direction? FYI: The item I want to...
4
by: Davids | last post by:
darn stuck again! in my string array string myArray = string; Let's say I've put a string field into the first 3 items and I guess the other 23 must then be null, right? OK so is there any C#...
1
by: Chris | last post by:
Hey Okay using DataBinder.Eval in a repeater. My question is this - if the value is empy, eg the myDownloadFile is empty, how can i display different output than if it was populated. #...
8
by: kimiraikkonen | last post by:
Hi, Just noticed that you're allowed to use combobox1.items.item property in VB.NET but NOT in C#... Intellisense doesn't show "item" property and build is failed. Is there a specific reason...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
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....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.