locked
Deserialize JSON object in C# RRS feed

  • Question

  • Hi,

    I am new to JSON and one of my service is returning JSON object as a string to my application. I need to Deserialize JSON object in C#.

    My JSON string is in the current format.
    string str = "{\"candidates\":[{\"address\":\"1580 MARKET ST, SAN FRANCISCO, CA, 94102\",\"location\":{\"x\":-122.42054,\"y\":37.7745960000001},\"score\":40,\"attributes\":{}},{\"address\":\"1576 MARKET ST, SAN FRANCISCO, CA, 94102\",\"location\":{\"x\":-122.420355,\"y\":37.7747030000001},\"score\":40,\"attributes\":{}}]}";
    Can anyone please help me how to get all the address, locations, score and attributes from the above string.

    Thankyou,
    Ravi.

    Friday, January 22, 2010 4:03 PM

All replies

  • Hi,

    I am new to JSON and one of my service is returning JSON object as a string to my application. I need to Deserialize JSON object in C#.

    My JSON string is in the current format.
    string str = "{\"candidates\":[{\"address\":\"1580 MARKET ST, SAN FRANCISCO, CA, 94102\",\"location\":{\"x\":-122.42054,\"y\":37.7745960000001},\"score\":40,\"attributes\":{}},{\"address\":\"1576 MARKET ST, SAN FRANCISCO, CA, 94102\",\"location\":{\"x\":-122.420355,\"y\":37.7747030000001},\"score\":40,\"attributes\":{}}]}";
    Can anyone please help me how to get all the address, locations, score and attributes from the above string.

    Thankyou,
    Ravi.


    Have you solved the problem? I have the similar question.
    Saturday, August 28, 2010 4:04 AM