Am a little confused as to how to get JSONGenerator.ToString to work.
I understand going from JSON maps and so on into a List and how to parse that, but I am confused about going the other way, for example from a SQL SELECT request into JSON strings.
I’ve created my own data type, BASE, and I use the following code to put BASE objects into a List which I return back to do with whatever I want. This code works fine, but I’d like to understand the JSON stuff a bit more.
How would I change this code to create JSON strings that I could return for use by a JSON parser? I have tried everything I can think of and am now stumped.
It’s fairly self-explanatory but the fields are ID, NAME_BASE, INFO, CITY in the example below.
Sub ReadBaseDataFromDB(SQL1 As SQL) As List
Dim BaseList As List
BaseList.Initialize
Dim Cursor1 As Cursor
Cursor1 = SQL1.ExecQuery("SELECT * FROM BASES")