Trying to convert a json object to DataTable
c#, json
Solution
Try this code .
String json="....some json string...";
DataTable tester = (DataTable) JsonConvert.DeserializeObject(json, (typeof(DataTable)));
It works for me.
And try to search in the google first time when you have problem like this. Trust me ,you are not the only one who got the same problem.
Problem
I am trying to convert a json object to `DataTable` using this method: ``` string jsonString="{"data":[{"uid":502458330,"name":"Mustapha Malass","pic_square":"https://fbcdn-profile-a.akamaihd.net/hprofile-ak-prn2/t5/276351_502458330_1748214131_q.jpg","online_presence":"idle"}," DataTable obj = JsonConvert.DeserializeObject<DataTable>(jsonString.ToString()); ``` but I get an error: Additional text found in JSON string after finishing deserializing object. PS: I didn't post all my json string because it's too big as you can see the `,` in the end wish point that the json is not complete.