I am using c# and i have a DataSet (ds) with 2 Datatables (dt1,dt2) having relations to each other. Now i want to convert the Dataset to a nested json string.
Option1:
string myresult = JsonConvert.SerializeObject(ds);
Using this creates a non-nested json string. Result: Displays all values from dt1 first, then all values from dt2
Option:2:
string myresult = ds.GetXml();
XmlDocument doc = new XmlDocument();
doc.LoadXml(myresult);
return (JsonConvert.SerializeXmlNode(doc));
When i use this i get a nested json string but int-values are displayed as string-values ("Id": 1 is displayed as "Id": "1")
I think Convert Dataset with Relation to JSON string is a similar issue - the answer creates the same result like option 2