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
Can one drop a column from a table?
What is purpose of normalization?
what is isolation level at dead lock?
How to create a new schema in a database?
Which autogrowth database setting is good?
Can we use trigger new in before insert?
What is sql service broker?
What is the language structure to add a record to a table?
What is right outer join in sql server joins?
What are the difference between data mart and data warehouse? : sql server analysis services, ssas
Suppose you want to implement the one-to-one relationships while designing tables. How would you do it?
What is acid properties?
What is Service Broker in sql server 2012?
What is hierarchy, what are its types and difference between them? : sql server analysis services, ssas
Explain the types of indexes.