I have a JSON string that I have deserialized using JavascriptSerializer in VB.NET. I need to loop through the deserialized data but am facing a challenge with the nested objects. How can I access SubBookingId from the JSON String below using a for each loop in vb.net
{
"Reservations": {
"Reservation": [
{
"BookingTran": [
{
"SubBookingId": "459",
"TransactionId": "1872700000000000699",
"Createdatetime": "2022-03-08 09:58:51",
"Modifydatetime": "2022-03-08 09:58:51",
"Status": "New",
"IsConfirmed": "1",
"CurrentStatus": "Confirmed Reservation",
"VoucherNo": ""
}
]
},
{
"BookingTran": [
{
"SubBookingId": "460",
"TransactionId": "1872700000000000700",
"Createdatetime": "2022-03-08 10:00:17",
"Modifydatetime": "2022-03-08 10:00:17",
"Status": "New",
"IsConfirmed": "1",
"CurrentStatus": "Confirmed Reservation",
"VoucherNo": "",
}
],
"IsChannelBooking": "1"
}
]
}
}
I am using a soap web service that returns a JSON string. The deserialization code is as below:
Dim dict As Object = New JavaScriptSerializer().Deserialize(Of List(Of Object))(JsonString)