Find key in a dictionary by index+vb.net 2005

Hi,
I need to fnd the keyname in dictionary by index
 For j = 0 To ColCount
DictionaryColumns == keyname at position j
next

Cheers
RIASAsked:
Who is Participating?
 
DhaestConnect With a Mentor Commented:
What exactly do you want to do, because in a dictonary you can only retrieve the items through the key ?

VB.NET Dictionary Tips and Examples

http://dotnetperls.com/dictionary-vbnet
Module Module1
    Sub Main()
        ' Put four keys into a Dictionary Of String.
        Dim dictionary As New Dictionary(Of String, Integer)
        dictionary.Add("please", 32)
        dictionary.Add("help", 16)
        dictionary.Add("program", 256)
        dictionary.Add("computers", -1)

        ' Loop over entries.
        Dim pair As KeyValuePair(Of String, Integer)
        For Each pair In dictionary
            ' Display Key and Value.
            Console.WriteLine("{0}, {1}", pair.Key, pair.Value)
        Next
    End Sub
End Module

Open in new window

0
 
Gautham JanardhanConnect With a Mentor Commented:
wont this do ?
Dim dic As New Dictionary(Of String, String)

        dic.Add("1", "1")
        dic.Add("2", "2")
        dic.Add("3", "3")

        For Each Item As String In dic.Keys
            MsgBox(Item)
        Next

Open in new window

0
 
RIASAuthor Commented:
Cheers mate will try and get back
0
 
joriszwaenepoelConnect With a Mentor Commented:
       Dim dic As New Dictionary(Of String, String)
       ' ...
        dim theKey = dic.Keys(index)

0
All Courses

From novice to tech pro — start learning today.