1

In my WCF based project i tried to bind my deserialized json data into my seperate labels.I implemented some of the stackoverflow answers.But still i didnt get the output. here is my c# code:

string k = TxtId.Text;
        byte[] datas = web.DownloadData("http://localhost:53274/Service1.svc/GetData?value=" + k);
        Stream stream = new MemoryStream(datas);
        DataContractJsonSerializer obj = new DataContractJsonSerializer(typeof(string));
        string result = obj.ReadObject(stream).ToString();
        var u = JsonConvert.DeserializeObject(result);

After deserialization i am getting the value of u is:

{ "Table": [ { "ICDCode": "A03.9", "ICDCodeDescription": "Shigellosis, unspecified", "ICDGroupCode": "A03", "ICDGroupDescription": "Shigellosis" } ] }

I want to bind these json object into seperate labels like

        lblcode.Text = 
        lblcodedesc.Text = 
        lblgrpcode.Text = 
        lblgrpdesc.Text = 

Can anyone help me..

Venkatesh
  • 11
  • 2
  • I don't know how to use Json.NET but going the route of `dynamic u = Json..` and `lblCode.Text = u.Table[0].ICDCode` might lead to the solution. There may be some hints in [StackOverflow: Deserialize json object into dynamic object using Json.net](http://stackoverflow.com/questions/4535840/deserialize-json-object-into-dynamic-object-using-json-net) – xmojmr Dec 22 '14 at 07:02

0 Answers0