Answer Posted / kumaresh
1.Hashtable is a class which falls into System.Collections
namespace.
you can create object for hashtable. For example,
Hashtable hash = new Hashtable();
2.Key and value should be added to hashtable. For example,
hash.Add(1,"God");
hash.Add(2,"Human");
3.The key, value will be sorted automatically based on the
Hashcode generated[this operation is taken care by CLR].
4.GetHashCode() method is used to get the generated hashcode
5.While retrieving the hashtable values, you can use the
key tp retrieve the values. For example
foreach (DictionaryEntry item in hashTable)
{
Console.WriteLine("Key is {0}, Value is
{1}", item.Key,item.Value);
}
NOTE: if you add the same key into the hastable, it will
not throw any compliation error, but during runtime, it
will throw "ArgumentException" error.
Is This Answer Correct ? | 19 Yes | 4 No |
Post New Answer View All Answers
What are the source of constraints?
Explain encryption of entire databases without the need for application changes in sql server 2008?
Explain about nested stored procedure?
What is exporting utility?
What does man by sql wildcard characters in sql server?
How do I view a trc file?
Write an sql query to sort a table according to the amounts in a row and find the second largest amount.
How to create a local temporary stored procedure?
hi, how to link a text file and a .rpt file in my tables of sql server and to retrieve those records for further use. reply me as soon as possible.
Why variables called the most powerful component of ssis?
Explain linked server in sql?
what is the sql equivaent of the dataset relation object ?
Can you pass expressions to function parameters?
What happens if null values are involved in string operations?
Explain tablesample?