I've created a datatable using json string, though, some headers in my json string contains an array like this:
[{"Header1":"123","Header2":["asdasda"]}]
I successfully created a datatable using json but it doesn't show up the header that contains an array value like in the Header2. Here is my sample code in creating my datatable:
strJson = Session("JsonStr").ToString
Dim tb As DataTable
tb = JsonConvert.DeserializeObject(Of DataTable)(strJson.ToString)
and everytime I try to fetch datatable to string, it appears. However, it only shows System.string[]
. Using the json example I gave, the output is:
Header1=123 | Header2=System.string[]
Instead of fetching System.string[], can it fetch the value which is in array ("asdasda")? Here's my code in transfering datatable to string:
Dim dr As DataRow
Dim dc As DataColumn
Dim sConcat As String = ""
For Each dr In UpdatedTable.Rows
For Each dc In UpdatedTable.Columns
sConcat = sConcat + dc.ColumnName + "= " + dr.Item(dc) + " | "
Next
Next dr