TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mohd Taufeeque
NA
56
20.9k
How to deserialize or parse the Json object into an array...
May 7 2020 6:25 AM
{
"shapes":[{"id":"A","cursor":"pointer","visual":null,"x":69.25,"y":50},{"name":"Right"},{"name":"Auto"}],"width":10,"height":10},"undoable":true}],
"connections":[{"id":"8Op6PApGWW","selectable":true,"serializable":true,"from":{"shapeId":"A"},"toX":null,"toY":null,"to":{"shapeId":"B"}}]
},
This is my json data.
I have to deserialize the data into an array format so i can access the from and to value of connections.
like var fromid=connections[0].from;
There are more than one shape and connections.
What I have tried is:
string jsonString = diagram.ResponseData.diagramJson;
JArray jsondata = (JArray)JsonConvert.DeserializeObject(jsonString);
But It will throw an error.
{"Unable to cast object of type 'Newtonsoft.Json.Linq.JObject' to type 'Newtonsoft.Json.Linq.JArray'."}
Is anything wrong while deserializing.
Reply
Answers (
4
)
to save gridview data to the database which has dropdownlist
Is thee any C# expert live now, please i need urgent help...