473,326 Members | 2,076 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,326 software developers and data experts.

Retrieving StringDictionary key by value

Hi,
I have a StringDictionary object with Key and Value pairs. I have a
situation where
1. I have to retrieve the Value for a given Key and
2. I have to retrieve the Key for a given Value.

Iam able to do the first requirement (As there is a provision to do that in
the class library) but the problem is with the second requirement.

Does anyone know how to retrieve the Key for a given value?.

Thanks in advance,
Regards,
Srikanth.

Nov 15 '05 #1
1 2998
Think of what you are asking. As an example think of the following example:

Key Value
Red Color
Blue Color
Inch Length
Foot Length

Now you can find easily that Inch is a Length, but if you were to ask for
Length then what would be returned. Remember that all classes are designed
to handle the general cases, if you want a specific you can create a new
class that inherits the base.

What you can do if there is are no duplicates in the Value is iterate
through the items and find the Key from the value.

Lloyd Sheen

"Srikanth" <br**@nospam.bryn.com.au> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi,
I have a StringDictionary object with Key and Value pairs. I have a
situation where
1. I have to retrieve the Value for a given Key and
2. I have to retrieve the Key for a given Value.

Iam able to do the first requirement (As there is a provision to do that in the class library) but the problem is with the second requirement.

Does anyone know how to retrieve the Key for a given value?.

Thanks in advance,
Regards,
Srikanth.

Nov 15 '05 #2

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

Similar topics

3
by: J.R | last post by:
I'm getting an error when I attempt to serialize a type StringDictionary, error suggests type not marked for Serialization, could someone tell me how to go about this? Thanks.
6
by: John | last post by:
Hi! I have a StringDictionary itialized as follows: private void frmICUCalculations_Activated(object sender, System.EventArgs e) { StringDictionary dataDict = new StringDictionary();...
4
by: Sanjay Vyas | last post by:
Sorry, forgot to cross post this one.. This is rather unusual as we would expect any Collection class to implement ICollection interface and furthermore a Dictionary class should implement...
2
by: Wamiq Ansari | last post by:
Hi!, I am trying to add a value to a StringDictionary using its Item Property in C#. However this throws an expection as follows: Cannot implicitly convert type 'Component.TemplateComponent' to...
2
by: rajmgopal | last post by:
Hi I am using a StringDictionary to store and pass a few string values retrieved from sql server database. I am using these values as inputs to several stored procedures After processing a few...
0
by: Simon Dahlbacka | last post by:
I was trying to use the built in settings management and added a User-scoped setting of type System.Collections.Specialized.StringDictionary I run my application, updated the Settings, did...
0
by: Hans | last post by:
Hello, I was trying to use the built in settings management and added a User-scoped setting of type System.Collections.Specialized.StringDictionary I run my application, updated the...
4
by: Peter K | last post by:
Hi are there any benefits in using StringDictionary over Dictionary<string, string? It appears they achieve the same thing... (I could be wrong of course). thanks, Peter
5
by: Sanjay Pais | last post by:
I have a table with over 1.3 million rows. I am retrieving only 20 at a time using the with - over clauses In query analyser, the data is retrieved in under a second. When retrieving using the...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.