how to read write data in dictionary using c# and VB.net

What is Dictionaries ?

Dictionaries are collections that are meant to store lists of key/value pairs to allow lookup of values based on a key.



Private Sub mycodetips()
Dim mycodetips As New Hashtable()
‘The first method.
mycodetips.Add(“MN145098”, “Mehran,Jn”)
‘The second method.
mycodetips(“MN18454”) = “Arman,Nas”
End Sub


private void CreateHashTable()
Hashtable mycodetips = new Hashtable();
//The first method.
mycodetips.Add(“MN145098”, “Mehran,Jn”);
//The second method.
mycodetips[“MN18454”] = “Arman,Nas”;

The way you can read the data

For Each Item As DictionaryEntry In mycodetips


foreach (DictionaryEntry Item in mycodetips) {


Passionate about coding and software development holding 10+ Years of experience including 6+ years of experience on Mobile application Development.

More Posts