I'm in the process of developing a vb.net win form that utilizes a URL to fetch a json file which I need to insert into a datatable. I'm facing a challenge with organizing my public class hierarchy without ending up with too many lines of code. Currently, I am attempting to dump all the information into a textbox but eventually plan to transfer it into a datatable for display on a datagridview. Here's a glimpse of the json file and the corresponding URL:
URL:
Snippet from the json file:
{
"status": "ok",
"meta": {
"count": 632,
"page_total": 7,
"total": 632,
"limit": 100,
"page": null
},
"data": {
...
The issue lies in the structure of the "data" section where there are multiple subfields like 1, 33, 49, etc. Creating a public class for each of these numbers seems inefficient. I seek guidance on how to list the attributes tier, name, and tank_id into a datatable efficiently.
My current vb.net code:
Imports System.Net
...
--------------------
I've attempted to handle this by serializing and deserializing the json result but encountered issues due to non-sequential id numbers. Any assistance would be greatly appreciated.
Dim tokenjson = JsonConvert.SerializeObject(uri1)
...
Thank you,