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 is an entity-relationship diagram (erd)?
What is temporal data type?
What is primary key index?
What is difference between view and materialized view?
We need to perform what steps in the following order to work with a cursor?
List the types of recovery model available in sql server?
What is replace and stuff function in sql server?
what is a transaction? : Sql server database administration
How many types of local tables are there in sql server?
How to download and install the scaled-down database adventureworkslt?
What is an sql server agent?
While using a cursor, how can you differentiate between a deleted row and a row that has been inserted with null data values?
Explain the difference between clustered and non-clustered index?
What are rows and columns?
How do you identify a foreign key?