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

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

    Expert Comment

    by:Fernando Soto
    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 62

    Expert Comment

    by:Fernando Soto

    Sorry posted to the wrong question.

    LVL 9

    Expert Comment

    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 85

    Accepted Solution


    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
    Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    729 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

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now