Access data in Nested Dictionary with Key item

0

I have some issue in accessing the dictionary item in VB.NET. My intension is to access the key without looping. The dictionary under consideration is nested to 4th level. The issue is that the Keys at level 1, level 2 an level 4 are known.

All I need to do was to extract the value linked to the last key item

Dim KeyOffset  as Integer
Dim PosKey as String
Dim Value as Double

'Some code to add data to dictionary. 

KeyOffset = DataDict("OuterKnownKey")("MidKnownKey").Count
PosKey= ("OuterKnownKey")("MidKnownKey").keys(KeyOffset)
Value= DataDict("OuterKnownKey")("MidKnownKey")(PosKey)("FourthKnownKey"))

I get the error as shown below at the line PosKey= ("OuterKnownKey")("MidKnownKey").keys(KeyOffset)

System.MissingMemberException HResult=0x80131512 Message=Overload resolution failed because no accessible 'keys' accepts this number of arguments. Source= StackTrace:

Can someone guide me where I am I going wrong?.

vb.net
dictionary
vsto
asked on Stack Overflow Apr 5, 2020 by Raghu • edited Apr 6, 2020 by Raghu

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0