Description:
I am developing a web solution in c # asp.net so that, from the front, put together an object JSON
complex so that, when received in the back, save the values in a SQL Server 2012 database.
The JSON
complex object is composed as follows:
[{
"__KEY__": "73c14f5b-cbb9-8711-217a-a1a5453b7159",
"sUserID": [80417452, 80426837, 79945118],
"FechaInicio": "2017-04-19T05:00:00.000Z",
"FechaFin": "2017-04-20T05:00:00.000Z",
"Id_Franja": 3
}]
By using the following lines to serialize the JSON object and convert it to DataTable
I get this result:
Code:
// La variable "myJson" contiene el JSON complejo.
DataTable jsonDataTable = (DataTable)JsonConvert.DeserializeObject(myJson, (typeof(DataTable)));
Result of serialization:
I must convert this complex JSON to a DataTable in C #; in this case, I need the values in the column "sUserID" to be in the DataTable
as a string separated by commas.
How to convert this complex JSON object into a DataTable?
I've tried these solutions , but I can not adjust the code to achieve this goal.
I am looking for other options to convert complex JSON objects "like the example" in DataTable.