Dictionaries within a list
Dictionaries within a list
Dictionaries within a list
Dictionaries within a list
Dictionaries within a list
Dictionaries within a list Dictionaries within a list Dictionaries within a list Dictionaries within a list Dictionaries within a list Dictionaries within a list Dictionaries within a list Dictionaries within a list
Dictionaries within a list Dictionaries within a list
Dictionaries within a list
Go Back  Xtreme Visual Basic Talk > > > Dictionaries within a list


Reply
 
Thread Tools Display Modes
  #1  
Old 12-14-2017, 06:58 AM
stokeentertainm's Avatar
stokeentertainm stokeentertainm is offline
Contributor
 
Join Date: Jan 2005
Location: Stoke-on-Trent, UK
Posts: 440
Default Dictionaries within a list


Hey all

I haven't been on here for about 5 years so I hope you are all still well.

Just getting back in to VB with Visual Studio 2017.

Quick question in relation to storing a list of dictionaries.

Code:
Dim D As New Dictionary(Of Integer,String)
Dim L as New List(Of Dictionary(Of Integer,String))
Let's say I wanted to search for a string in just the key number 2 in the list of dictionary entries, is that possible?

I'm used to dealing with 1 dimension e.g. a simple list of strings.

Thanks,

Matt.
Reply With Quote
  #2  
Old 12-15-2017, 04:30 AM
passel's Avatar
passelDictionaries within a list passel is offline
Sinecure Expert

Super Moderator
* Guru *
 
Join Date: Jun 2003
Location: Upstate New York, usa
Posts: 8,031
Default

There is probably some Linq query you could setup to do it, but using Linq is definitely not my strong suit. I would probably end up just looping through the dictionaries in the list using For Each, checking to see if key number 2 existed in the dictionary and then compare the string associated with that key, if that is what you want.
__________________
There Is An Island Of Opportunity In The Middle of Every Difficulty.
Miss That, Though, And You're Pretty Much Doomed.
Reply With Quote
Reply

Tags
list, dictionaries, dim, dictionaryof, integer, string, key, search, listof, string, dictionary, e.g, dimension, simple, strings, matt, dealing, entries, relation, hope, hey, studio, quick, question, storing, visual


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Dictionaries within a list
Dictionaries within a list
Dictionaries within a list Dictionaries within a list
Dictionaries within a list
Dictionaries within a list
Dictionaries within a list Dictionaries within a list Dictionaries within a list Dictionaries within a list Dictionaries within a list Dictionaries within a list Dictionaries within a list
Dictionaries within a list
Dictionaries within a list
 
Dictionaries within a list
Dictionaries within a list
 
-->