Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to parse my json string in C#(4.0)using Newtonsoft.Json package?
    text
    copied!<p>I am new to JSON.In my asp.net application i want to parse the json string.So, i have used Newtonsoft.Json package for reading and writing json data.Now, i can able to parse the simple json data.But now i have received some complex json data for parsing.So, i little bit struck on it.</p> <p><strong>This is JSON Data:</strong></p> <pre><code>{ quizlist: [ { QUIZ: { 'QPROP': [ { 'name': 'FB', 'intro': '', 'timeopen': '1347871440', 'timeclose': '1355733840', 'timelimit': '0', 'noofques': '5', 'QUESTION': { 'QUEPROP': [ { 'questiontext': 'Scienceisbasedont', 'penalty': '0.3333333', 'qtype': 'shortanswer', 'answer': 'cause-and-effect', 'mark' : '5', 'hint': '' }, { 'questiontext': 'otherscientistsevaluateit', 'penalty': '0.3333333', 'qtype': 'shortanswer', 'answer': 'Peerreview', 'mark' : '5', 'hint': '' }, { 'questiontext': 'Watchingavariety', 'penalty': '0.3333333', 'qtype': 'shortanswer', 'answer': 'inductive', 'mark' : '5', 'hint': '' }, { 'questiontext': 'coveriesorideas', 'penalty': '0.3333333', 'qtype': 'shortanswer', 'answer': 'paradigmshift', 'mark' : '5', 'hint': '' }, { 'questiontext': 'proportions', 'penalty': '0.3333333', 'qtype': 'shortanswer', 'answer': 'fixed', 'mark' : '5', 'hint': '' } ] } } ] } } ] } </code></pre> <p><strong>This is my C# Code :</strong></p> <pre><code>dynamic dynObj = JsonConvert.DeserializeObject(jsonString); foreach (var data in dynObj.quizlist) { foreach (var data1 in data.QUIZ.QPROP) { Response.Write("Name" + ":" + data1.name + "&lt;br&gt;"); Response.Write("Intro" + ":" + data1.intro + "&lt;br&gt;"); Response.Write("Timeopen" + ":" + data1.timeopen + "&lt;br&gt;"); Response.Write("Timeclose" + ":" + data1.timeclose + "&lt;br&gt;"); Response.Write("Timelimit" + ":" + data1.timelimit + "&lt;br&gt;"); Response.Write("Noofques" + ":" + data1.noofques + "&lt;br&gt;"); } } </code></pre> <p>I can able to parse until noofques object in QPROP array objects.Now have to parse data.QUIZ.QPROP.QUESTION.QUEPROP array objects also...</p> <p>But i failed to parse fully...</p> <p>Please guide me to get out of this issue...</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload