I have problem to get "kode" from "list" as array from this object.
{
"metaData":{
"code":"200",
"message":"Sukses"
},
"response":{
"list":[
{
"kode":"31486",
"nama":"Satro Jadhit, dr"
},
{
"kode":"31492",
"nama":"Satroni Lawa, dr"
}
]
}
}
i can get anything except array from JSON. i've tried to use this solution [How to read JSON http post response using VB
and other solution too but my vb don't have some feature from newtonsoft json. I use visual studio 2005, .net framework 2.0
So, how I get it as my array.
Edit
this is what i've tried, and I can get value from the "list" (i use another code, so this value it's different)
Imports Newtonsoft.Json
Imports Newtonsoft.Json.Linq
Dim kodeDpjp as string
Dim json As String = responseFromServer
Dim serObj As Newtonsoft.Json.Linq.JObject =
Newtonsoft.Json.Linq.JObject.Parse(json)
Dim token As Newtonsoft.Json.Linq.JToken = serObj.SelectToken("response")
("list")
If (token.GetType() Is GetType(Newtonsoft.Json.Linq.JArray)) Then
Console.WriteLine(token)
End If
and this is the result
[
{
"kode": "8784",
"nama": "drg.MELANI SARI TANJUNG"
},
{
"kode": "8848",
"nama": "drg.ARIEF KURNIAWAN"
},
{
"kode": "8873",
"nama": "drg.SRI ARIANI SUGIARTI"
}
]
i just want "kode" for my array in combobox
Thank you