
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 2587 Articles for Csharp

3K+ Views
The hashtable collection in C# is a non-generic collection of elements. Each element of the hashtable is represented as a key-value pair. The keys of the hashtable are non-null and unique. The values can be duplicated and/or null. The Hashtable class of C# Systems.The collections interface is the representation of a hashtable collection. This class provides various constructors, methods, and properties to manipulate the hashtable collection. We can also convert hashtables into other collections like arrays, ArrayList, etc., and also to a string representation. In this article, let’s discuss how we can convert a hashtable collection into a string. How ... Read More

2K+ Views
The hashtable collection in C# is a non-generic collection of items represented as key-value pairs. Each key is a unique, non-null element. The value on the other hand can be duplicated and/or null. The Hashtable class in C# represents the hashtable collection. This class provides the relevant methods to create objects, alter items in the collection, etc. The hashtable collection can be expressed as an array or ArrayList in C#. In this article, let’s discuss how we can convert a hashtable collection into an array. How to Convert Hashtable into an Array? To convert the hashtable into an array, the ... Read More

399 Views
The hashtable collection in C# is a non-generic collection of key-value pairs that are organized based on the key’s hash code. The key is used to access the elements in the hashtable collection. Hashing helps us to efficiently retrieve data and eliminates the need for costly techniques of searching data. Hashing technique used the key itself to locate the data. This hashtable key is immutable and does not allow duplicate entries in the hashtable. The Hashtable class is defined in the System.Collections namespace provides the base class libraries for hashtable collection in C#. This Hashtable class is used to create ... Read More

743 Views
Hashtable collection in C# is a collection of elements wherein each element consist of key-value pair. The key of the element is unique and non-null while the value of the element can be duplicated or even null. The key-and-value pairs are organized based on the hash code of the key. The key is used to access the elements in the collection. In C#, the class named Hashtable represents the hashtable collection. This class provides various constructors to construct/create the hashtable object. The Hashtable class also provides various methods and properties using which we can manipulate the hashtable collection. Let’s ... Read More

647 Views
The hashtable collection in C# stores key-value pairs. Each element or item in this collection is a key-value pair i.e. this collection is a double-element collection. The Key is unique, non-null, and used to access the elements in the hashtable. The hashtable collection is immutable and cannot have duplicate elements. This means combination of key-value should be unique. However, the values can be null or duplicated. The .Net Framework provides a HashTable class to implement the hashtable collection and contains the required functionality to implement a hashtable without any additional coding. Each element within the hashtable collection is a DictionaryEntry ... Read More

1K+ Views
A hash table is a collection in C# that holds items identified as key-value pairs. So unlike other data structures like the stack, queue, or ArrayList in C# that store a single value, hashtable in C# stores 2 values. These 2 values i.e. key-value pair form an element of the hash table. In a hashtable, the keys are unique and should not be null. The values in the hashtable can be null and also duplicated. In C#, the System.collections interface provides a class “Hashtable” which is used to represent the hashtable collection. This class provides various constructors to create a ... Read More

2K+ Views
The hashtable is an organized collection of key-value pairs wherein the keys are arranged as per the hash code of the key calculated using the hash function. While the keys should be non-null and unique in a hashtable, the values can be null and duplicate. The elements in the hashtable are accessed using the keys. In C#, the class “Hashtable” represents the hashtable collection. This class provides various properties and methods using which we can perform operations and access data in the hashtable. In this article, we will see how we can determine if a particular value is present ... Read More

1K+ Views
The Hashtable collection in C# is a collection of key-value pairs that are organized based on the hash code of the key. The hash code is calculated using a hash code function. Each element in the hashtable is a key-value pair with unique keys. Keys also have to be nonnull. Values can be null and duplicated. In this article, we will discuss how to check if the hashtable collection is empty. How to Check if the Hashtable Collection is Empty? The class in C# that implements the hashtable collection is the Hashtable class. We can check if the hashtable collection ... Read More

7K+ Views
A hashtable is a collection of key−value pairs. We can access key−value pairs using an iterator. We can also access the keys of the hashtable in a collection. Similarly, we can access the values in a hashtable. Given a hashtable, it is also possible to access the value of a specified key or matching key of a specified value. Let’s discuss how we can access a value from the hashtable collection given a key. How to Get Value from Hashtable Collection using Specified Key? Here, we have to obtain a value from the key−value pair of hashtables when a ... Read More

413 Views
The HashTable is a non−generic collection in C#. It stores key−value pairs and is similar to a generic “Dictionary” collection. HashTable is defined in System.Collections.namespace. HashTable consists of key/value pairs in which each key is computed as a hash code and stored in a different bucket internally. Whenever the HashTable is accessed, this hash code is matched to the hash code of the specified key and thus the corresponding values are accessed. This mechanism optimizes the lookup in the HashTable. Let’s now discuss how to get keys from a HashTable in C#. How to Get Keys from a HashTable? ... Read More