[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


What’s the .NET datatype that allows the retrieval of data by a unique key?

Posted on 2006-05-04
Medium Priority
Last Modified: 2008-03-06
What’s the .NET datatype that allows the retrieval of data by a unique key?
Question by:chuang4630
  • 2
LVL 64

Expert Comment

by:Fernando Soto
ID: 16609315
Hi chuang4630,

Yes it can. Set a breakpoint then when the program breaks right click on the variable you want to change and select Add Watch. Now go to the Watch window and double click on the value you want to change and set it the new value and hit return.
I hope that this was of some help.

LVL 64

Expert Comment

by:Fernando Soto
ID: 16609329

Sorry posted to the wrong question.


Expert Comment

ID: 16610406
In .NET 2.0 it's the generic Dictionary collection.

Here is an example:

Dictionary<string, int> x = new Dictionary<string, int>();
x["a"] = 1;
x["b"] = 2;
if (x.ContainsKey("a"))
foreach (KeyValuePair<string, int> item in x) {
    Console.WriteLine(String.Format("{0} -> {1}", item.Key, item.Value));

You may use a compound type instead of int.
LVL 86

Accepted Solution

Mike Tomlinson earned 2000 total points
ID: 16611027

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month18 days, 18 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question