How to Create Dictionary in Vb.Net


  • How to Create Dictionary in Vb.Net



  • 2 Comments sorted by


  • Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim dic As New Dictionary(Of String, Integer)
    dic.Add("Faraz", 1)
    dic.Add("Shahan", 2)

    If dic.ContainsKey("Faraz") Then
    MessageBox.Show(dic.Item("Shahan"))
    End If
    End Sub
  • You have to be aware that there are multiple dictonaries classes you can use beside Dictionary.For example:ListDictionary,StringDictionary,SortedDictionary.They provide fast lookup.
    http://msdn.microsoft.com/en-us/library/System.Collections.Generic(v=vs.110).aspx


Howdy, Stranger!

It looks like you're new here. If you want to get involved, or you want to Ask a new Question, Please Login or Create a new Account by Clicking below

Login with Facebook

Popular Posts of the Week

Top Posters Weekly

Optimum Creative