@Murari Ram , you could try the following code to get data from json object.
string jsonString = "{\"d\":{\"Head_TO_Res_Det\":{\"results\":[{\"Status\":\"E\",\"Task\":\"\",\"Pernr\":\"17015263\",\"Reason\":\"Error - Employee currently in Bench\"}]},\"Head_TO_Pos_Det\":{\"results\":[]},\"LvText\":\"\",\"Pernr\":\"00000000\"}}";
dynamic stuff = JObject.Parse(jsonString);
Console.WriteLine(stuff.d.Head_TO_Res_Det.results);
foreach (JObject item in stuff.d.Head_TO_Res_Det.results)
{
foreach (JProperty jp in item.Properties())
{
Console.WriteLine(jp.Name);
Console.WriteLine(jp.Value);
Console.WriteLine("*****");
}
}
Console.WriteLine(stuff.d.Head_TO_Pos_Det);
Console.ReadKey();
Please note that we need to install nuget-package Newtonsoft.Json
first of all.
Result:
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.