473,396 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Get index from a Dictionary

Hi all,
I have a Dictionary like this:

Dictionary<string, Object>

and I need to retrieve the index (0,1,2, etc) of a particular key (based on
dictionary insertion).

How can I accomplish this?

Thanks in advance.

--
Luigi
http://blogs.dotnethell.it/ciupaz/
Oct 9 '08 #1
1 2793
Create a facade class that acts as the data source. Inside that class have
both a List and a Dictionary that you maintain. Use the dictionary for
quickly locating items based on their key, and the list for determining
items at a specific index.

--
Pete
====
http://mrpmorris.blogspot.com
http://www.capableobjects.com

Oct 9 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Andrew Dalke | last post by:
Is there an author index for the new version of the Python cookbook? As a contributor I got my comp version delivered today and my ego wanted some gratification. I couldn't find my entries. ...
9
by: custard_pie | last post by:
I need help sorting a list...I just can't figure out how to sort a list and then return a list with the index of the sorted items in the list for example if the list I want to sort is I need to...
2
by: Bill Ray | last post by:
I have the following function in my WidgetCollection class. What is a more efficient way of doing this? I tried the commented code below, but I couldn't get it to work. Public Overloads ReadOnly...
8
by: Sam | last post by:
Hi, Here is my code : For Each row As DataRow In ds.Tables(0).Rows next How can I get the index of the row being processed ? Thx
4
by: techiepundit | last post by:
I'm a Python newbie who just started learning the language a few weeks ago. So these are beginner questions. I have a list of sockets that I use for select.select calls like this: ...
5
by: gmccallum | last post by:
I am trying to create a base class that contains a collection that MUST be able to be referenced by both a string key and a positional index. This collection MUST keep the items in the same order...
3
by: Glenn | last post by:
Hello again, New question, is it possible to do anything similar to PHP where you're able to use a string as an index to another? Say you're reading a file of different types of fruit, and...
122
by: C.L. | last post by:
I was looking for a function or method that would return the index to the first matching element in a list. Coming from a C++ STL background, I thought it might be called "find". My first stop was...
2
by: hall.jeff | last post by:
Before the inevitable response comes, let me assure you I've read through the posts from Guido about this. 7 years ago Guido clearly expressed a displeasure with allowing these methods for tuple....
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.