473,385 Members | 1,409 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,385 software developers and data experts.

Reading from HashTable

What is the member function to return values from a HashTable? I've been up
and down the list in VS and I cannot find anything of relevance.

All the examples speak of a member function named "item", well it just
isn't there!

Cheers
Rich.
Nov 16 '05 #1
2 5759
The member function is there; it just looks different in C#. In the
documentation if you click through on the member variable, it will give you
the definition of the function in VB, C#, C++, and JScript. The C#
definition looks like this:

[Serializable]
public virtual object this[
object key
] { get; set;}

In a practical example, the way that the item is retrieved would look like
this;

object item = ht[key]; //where ht is a hashtable and key is the object key.

Hope this helps.

--
Ben Lucas
Lead Developer
Solien Technology, Inc.
www.solien.com
"Kavvy" <r@hfeajhjgg.gt> wrote in message
news:nu****************************@40tude.net...
What is the member function to return values from a HashTable? I've been up and down the list in VS and I cannot find anything of relevance.

All the examples speak of a member function named "item", well it just
isn't there!

Cheers
Rich.

Nov 16 '05 #2
On Mon, 2 Aug 2004 16:02:53 -0700, Ben Lucas confounded his critics by
announcing:
The member function is there; it just looks different in C#. In the
documentation if you click through on the member variable, it will give you
the definition of the function in VB, C#, C++, and JScript. The C#
definition looks like this:

[Serializable]
public virtual object this[
object key
] { get; set;}

In a practical example, the way that the item is retrieved would look like
this;

object item = ht[key]; //where ht is a hashtable and key is the object key.

Hope this helps.


Thank you, time for a good book I think!
Nov 16 '05 #3

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

Similar topics

5
by: francois | last post by:
First of all I would to to apologize for resending this post again but I feel like my last post as been spoiled Here I go for my problem: Hi, I have a webservice that I am using and I would...
33
by: Ken | last post by:
I have a C# Program where multiple threads will operate on a same Hashtable. This Hashtable is synchronized by using Hashtable.Synchronized(myHashtable) method, so no further Lock statements are...
16
by: Sreekanth | last post by:
Hello, Is there any better collection than HashTable in terms of performance, when the type of the key is integer? Regards, Sreekanth.
5
by: microsoft.news.com | last post by:
I'm reading a text file data and creating a new one with only certain data. In the new file I need to format like so Delaware Dover Wilmington New Castle New York ...
3
by: Fred | last post by:
I'm trying to build a hashtable and a arraylist as object value I'm not able to retrieve stored object from the hashtable. Hashtable mp = new Hashtable(); // THE HASHTABLE ArrayList...
0
by: Chris Dunaway | last post by:
Enterprise Library January 2006 Visual Studio 2005 Lanugage: C# I am attempting to use the Enterprise Library to read data from an Excel spreadsheet file. I got the following connection...
2
by: archana | last post by:
Hi all, I am having one confusion regarding hashtable. I am having function in which i am passing hashtable as reference. In function i am creating one hashtable which is local to that...
5
by: ShadowLocke | last post by:
This class makes use of System.Collections.Hashtable to enumerate all the settings in an INI file for easy access. Its very simplistic, and completely re-useable. Solid addition for any app that...
1
by: cmrhema | last post by:
Hi, All I have a program in C# where I am reading all the messages from a MSMQ. I have declared a class Queue as below public class MyQueue { public static Queue myqueue;...
1
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.