我收到通过HTTP POST下面的字符串作为JSON:错误转换JSON到数据表在vb.net
Dim json As String = "[{" + """name"":""jocelyne" + """," + """mo"":""jocelyne" + """}" + ",{" + """name"":""eliane" + """," + """mo"":""12345678" + """}" + "]"
我需要这个JSON数组转换成一个DataTable在vb.net
我使用NewtonSoft.json.dll尝试:
Dim jss As New System.Web.Script.Serialization.JavaScriptSerializer()
Dim deserializedProduct As Dictionary(Of String, String) = JsonConvert.DeserializeObject(Of Dictionary(Of String, String))(json)
,但我不断收到有可用于当前位置没有源代码,虽然我加入了参考我的项目,它在bin文件..
实际的错误是:
Cannot deserialize JSON array into type 'System.Collections.Generic.Dictionary`2[System.String,System.String]'.
是有办法解决这个问题还是没有人有另一种方式来JSON数组转换为vb.net一个DataTable?
其不正确的json – Shruti
@Shruti在json中有什么不正确? – User7291
你可以验证你的JSON使用这个链接http://jsonlint.org/ ..在这里你的JSON和你会知道 – Shruti