I'm trying to get a value from a json string using Newtonsoft, but I can't seem to figure this one out.
Here is the json string:
I'm trying to get the value in the results>COUNT(*) node. (9129 in this case)Code:{ "error_message": "", "success": true, "metadata": [ { "id": "COUNT(*)", "key": "COUNT(*)", "name": "COUNT(*)", "type": "number", "data": null, "table_id": "", "table_name": "", "base_id": "" } ], "is_join_stmt": false, "results": [ { "COUNT(*)": 9129 } ] }
I have tried the following code, but this gives me an error:
Any help would be appreciated. Thanks...Code:Dim jsonObject As JObject = JObject.Parse(jsonString) resultsNode = jsonObject("results") Dim count As String = resultsNode(0).SelectToken("COUNT(*)").ToString




Reply With Quote