---
title: "How to parse JSON Array using Newtonsoft?"  
description: "How to parse JSON Array using Newtonsoft?"  
author: "Anonymous User"  
published: 2015-01-19  
updated: 2015-01-19  
canonical: https://www.mindstick.com/forum/12876/how-to-parse-json-array-using-newtonsoft  
category: "asp.net"  
tags: ["json", "json.net", "array"]  
reading_time: 1 minute  

---

# How to parse JSON Array using Newtonsoft?

I'm working on a [project](https://www.mindstick.com/articles/105927/how-to-excel-at-managing-multiple-projects) in which I want to **deserialize** a [JSON Array](https://www.mindstick.com/forum/12870/how-to-parse-json-array-using-newtonsoft). I have tried but didn't get how to parse it.

**JSON ARRAY:**

{"showAttendanceResult":[{"lec_no":"FA10-BCS-40","reg_no":"2","std_status":"A","std_username":"fahidnadeem"},{"lec_no":"FA10-BCS-4","reg_no":"2","std_status":"A","std_username":"muneebamjad"}]}

Here is the JSON which I get from the [WebService](https://www.mindstick.com/forum/166/webservice-method):

**How I Tried:**

[string](https://www.mindstick.com/articles/1527/string-split-in-c-sharp) URL = "http://localhost:32319/ServiceEmployeeLogin.svc/getattendance";

WebRequest wrGETURL;

wrGETURL = WebRequest.Create(URL + "/" + Server.UrlEncode("24-06-2014"));

wrGETURL.Method = "POST";

wrGETURL.ContentType = @"[application](https://www.mindstick.com/articles/12824/calculator-application-in-android)/json; charset=utf-8";

HttpWebResponse webresponse = wrGETURL.GetResponse() as HttpWebResponse;

[Encoding](https://www.mindstick.com/interview/752/how-is-encoding-handled-in-ajax) enc = System.Text.Encoding.GetEncoding("utf-8");

// read [response](https://www.mindstick.com/forum/12719/how-to-make-response-write-display-special-character-like-lt-gt) [stream](https://yourviews.mindstick.com/view/88509/us-intercepts-iranian-tanker-m-t-stream-amid-hormuz-tensions) from response object

[StreamReader](https://www.mindstick.com/forum/161576/explain-the-difference-between-streamreader-and-file-readalllines) loResponseStream = new StreamReader(webresponse.GetResponseStream(), enc);

// read string from stream data

strResult = loResponseStream.ReadToEnd();

// close the stream object

loResponseStream.Close();

// close the response object

webresponse.Close();

RootObject ro = [JsonConvert.DeserializeObject](https://www.mindstick.com/forum/161290/how-does-jsonconvert-deserializeobject-work-in-c-sharp)<RootObject>(strResult);

//what to do now?

}

}

public class ShowAttendanceResult

{

public string lec_no { get; set; }

public string reg_no { get; set; }

public string std_status { get; set; }

public string std_username { get; set; }

}

public class RootObject

{

public List<ShowAttendanceResult> showAttendanceResult { get; set; }

}

## Replies

### Reply by Anonymous User

RootObject ro = JsonConvert.DeserializeObject<RootObject>(strResult);

foreach(var item in ro.showAttendanceResult)

{

string _name= item.lec_no;

}


---

Original Source: https://www.mindstick.com/forum/12876/how-to-parse-json-array-using-newtonsoft

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
