JSON.NET "System.OutOfMemoryException" when deserializing into a DataSet
- by Tiago
Very new to C# and JSON. I have been struggling with this problem for about a day and can't figure it out.
JSONLint states both JSON strings are valid.
Trying to deserialize the following
{"items":[{"id":"1122267","quantity":"1","bundle":"1"}],"seconds_ago":"1"}
throws the exception
An unhandled exception of type 'System.OutOfMemoryException' occurred
in Newtonsoft.Json.dll
If I try
{"items":[{"id":"1122267","quantity":"1","bundle":"1"}]}
it works.
I'm reading the JSON string from a textbox and then deserializing using the following
string json = textBox1.Text;
DataSet dataSet = JsonConvert.DeserializeObject<DataSet>(json);