As I explained to you in this solution to your previous question [
^]:
You must provide a valid class structure to use JSON de-serialize on Web data, and
that structure will almost certainly be different for each web-site that provides JSON you can grab.
And, since any given web-site may decide to change that structure at any time,
you should not assume that code you have that works today using today's class structure provided by the site
will work in the future.
If I go to the JSONToCSharp web-site I showed you how to use in my previous answer, and generate a class structure for the Chennai website you use here: this is returned
public class MMChennai_JSON
{
public class ConnectionRespons
{
public double distance { get; set; }
public string hoursOfOperation { get; set; }
public string address { get; set; }
public string connection { get; set; }
public string iomsId { get; set; }
public string restaurantName { get; set; }
public override string ToString()
{
return this.restaurantName;
}
}
public class RootObject
{
public List<connectionrespons> connectionResponses { get; set; }
public object message { get; set; }
public int acknowledge { get; set; }
}
}</connectionrespons>
Using the code in the previous solution, I can de-serialize this without error in Visual Studio 2013, .NET 4.5.
Note: I added an over-ridden 'ToString method in the ConnectionRespon which can be used to determine what is displayed in a ListView whose 'DataSource is set to the the List of ConnectionRespon contained in the de-serialized data:
string wuUri =
@"http://23.253.66.248:8080/icc/api/venue/search/?lat=39.540544&lon=-104.866115&appkey=123Chesse&restName=MyMacChennai&organization=MyMacChennai";
MMChennai_JSON.RootObject MMChennai_JSON_Result = Parse_MMChennai_JSON(wuUri);
if (MMChennai_JSON_Result != null)
{
listBox1.DataSource = MMChennai_JSON_Result.connectionResponses;
}
else
{
}