jsonSerializer.DeserializeObject and arrays
Posted
by Chin
on Stack Overflow
See other posts from Stack Overflow
or by Chin
Published on 2010-04-12T09:37:50Z
Indexed on
2010/04/12
9:43 UTC
Read the original article
Hit count: 926
I have a column in the a database with values like the below.
[{"noteText":"Today was sunny.","noteDate":"2010-03-30 10:06:22"},{"noteDate":"2010-04-06 13:21:36","noteText":"Today was windy."}]
I think they are from an array of objects serialized via flash to Json. What I need to do is pull out the noteText and noteDate values only and record them back to the database as a normal string. I was hoping to just deserialize back to objects and build up a string from there, however, due to my unfamiliarity with c# and .Net I've hit a brick wall trying to deserialize the string.
var obj = jsonSerializer.DeserializeObject(ns);
Am I going in the right direction or should I be looking at doing some string manipulation?
Any pointers much appreciated.
© Stack Overflow or respective owner