Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6888885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:05:04+00:00 2026-05-27T06:05:04+00:00

I am sort of new to C# programming and am having trouble with the

  • 0

I am sort of new to C# programming and am having trouble with the dictionary using .net 4.0.

I have sent a JSON object through JavaScriptSerializer into a Dictionary<string, object> object which worked great at extracting all the data.

JSON chain

{ 
    "name" : "MrMonkey", 
    "type" : "monkey", 
    "location" : { 
        "id" : "125235",
        "name" : "zoo" 
    }, 
    "owner" : { 
        "id" : "4211", 
        "name" : "Biggles" 
    }
}

In this dictionary object created I have daughter levels that store information I need to extract from the dictionary and store elsewhere. Say I want is to extract the location name. As you can see it also shares a keyname with the parent level and another daughter level.

For the parent level I can extract information as simply as contact.name = dict["name"].ToString(); but how would I go about extracting the required information from the daughter levels?

I was able to create a work around in JSON.net to get this to work with a little bit of fiddling by checking the datatype and then converting it if it fell within a certain type, but this was aggravating and I been told by the boss not to use JSON.net.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:05:05+00:00Added an answer on May 27, 2026 at 6:05 am

    Without having tried, I’d try something like: (dict["location"] as Dictionary<string,object>)["name"], as I’d presume from the JSON you’ve provided, that the daughters themselves are again deserialized into Dictionarys.

    Anyway, the debugger will help you a lot here. If you set a breakpoint on the line after the call to the deserialization, you can inspect your dictionary (point the mouse to it and wait a second) and have a look at how your structure is now stored in C# objects.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to Objective-C and iPhone I have to sort a NSDictionary using
Hello I am new to programming working on Selenium using Ruby and I'm having
I'm sort of new to programming asynchronously. I've run into a situation where I
I'm sort of new to programming with CoreData, so I have no idea how
Hey there, I'm sort of new to Objective-C, and well, programming in general. I
I have been asked to post a new question about how to correctly sort
Hi I am new to web programming. I want to create a template sort
I'm new to scripting, but I have a lot of experience programming in languages
I'm fairly new to programming and have been focussing a great deal on Java
I'm sort of new to programming so I'm sure this is an easy answer.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.