Net-informations.com
SiteMap  | About    

ASP.NET HashTable



Hashtable represents a collection of key/value pairs which maps keys to value. Any non-null object can be used as a key but a value can. We can retrieve items from hashTable to provide the key . Both keys and values are Objects.

Add a pair of values in a HashTable

VB.Net

C#

Check if a specified key exist or not

VB.Net

C#

The above code return true if item exist else false.

Remove the specified Key and corresponding Value . HashTable.Remove(Key)

VB.Net

C#

Following code display all key value pairs.

VB.Net

C#

The following ASP.NET program add seven days in a week to a HashTable and bind it to a ListBox control.

Default.aspx




Click the following links to see full source code

C# Source Code
VB.NET Source Code
Default.aspx.cs
Default.aspx.vb





net-informations.com (C) 2019    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.