So I have this Json file:
{
"Name": "String",
"Age "String",
"Date": "9/2/2021",
"DataArray": [
{
"Account Number": "ABC123",
"Amount": 100,
"Product Code": "A1",
},
{
"Account Number": "GHC843",
"Amount": 250,
"Product Code": "B3",
}
]
}
I can deserialize and get the value from the keys of the ‘Name’ ‘Age’ and ‘Date’, and now I need to Deserialize JSON Array the ‘DataArray’ but entering the json file would error a
Deserialize JSON Array: Error reading JArray from JsonReader. Current JsonReader item is not an array: StartObject. Path '', line 2, position 1.
I know I can manually get each Key and Value by doing:
JsonObj("DataArray")(0)("Key").ToString
But my json file varies and would sometimes contains multiple sets inside the array. I hope there is a way around this.