I set up a test DreamFactory server and I am trying to transform the results from JSON to a DataTable so I can display a GridView. I've tried several things with no success, this is my current code:
var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
result = streamReader.ReadToEnd();
dynamic d = JObject.Parse(result);
object obj = JsonConvert.DeserializeObject(result);
var table = JsonConvert.DeserializeObject<DataTable>(result); <--ERROR
I've tried several methods but I am getting the following error most of the time:
Unexpected JSON token when reading DataTable. Expected StartArray, got StartObject. Path '', line 1, position 1.
It can deserialize fine as the object shows me the full deserialized JSON with no problems. Anything I can do?
EDIT: JSON Structure