Deserialized an object into a DataTable
up vote
0
down vote
favorite
I have a JSON
response like this:
"cod": "OK",
"list": [
"date": "31/10/2018", "count": "109", "name": "PAUL" ,
"date": "30/09/2018", "count": "103", "name": "LUKE"
]
I use:
Dim jss As New JavaScriptSerializer
Dim Response = jss.Deserialize(Of Object)(strResponse)
Dim Cod = Response("cod")
Then:
Dim Lista_documents = Response("list")
And I have an object with the list of documents.
How can I populate a new DataTable
?
json vb.net datatable
add a comment |
up vote
0
down vote
favorite
I have a JSON
response like this:
"cod": "OK",
"list": [
"date": "31/10/2018", "count": "109", "name": "PAUL" ,
"date": "30/09/2018", "count": "103", "name": "LUKE"
]
I use:
Dim jss As New JavaScriptSerializer
Dim Response = jss.Deserialize(Of Object)(strResponse)
Dim Cod = Response("cod")
Then:
Dim Lista_documents = Response("list")
And I have an object with the list of documents.
How can I populate a new DataTable
?
json vb.net datatable
You didn't explain how you want to populate it.
– CruleD
yesterday
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a JSON
response like this:
"cod": "OK",
"list": [
"date": "31/10/2018", "count": "109", "name": "PAUL" ,
"date": "30/09/2018", "count": "103", "name": "LUKE"
]
I use:
Dim jss As New JavaScriptSerializer
Dim Response = jss.Deserialize(Of Object)(strResponse)
Dim Cod = Response("cod")
Then:
Dim Lista_documents = Response("list")
And I have an object with the list of documents.
How can I populate a new DataTable
?
json vb.net datatable
I have a JSON
response like this:
"cod": "OK",
"list": [
"date": "31/10/2018", "count": "109", "name": "PAUL" ,
"date": "30/09/2018", "count": "103", "name": "LUKE"
]
I use:
Dim jss As New JavaScriptSerializer
Dim Response = jss.Deserialize(Of Object)(strResponse)
Dim Cod = Response("cod")
Then:
Dim Lista_documents = Response("list")
And I have an object with the list of documents.
How can I populate a new DataTable
?
json vb.net datatable
json vb.net datatable
edited yesterday
Jimi
5,61821032
5,61821032
asked yesterday
LukaGer
62
62
You didn't explain how you want to populate it.
– CruleD
yesterday
add a comment |
You didn't explain how you want to populate it.
– CruleD
yesterday
You didn't explain how you want to populate it.
– CruleD
yesterday
You didn't explain how you want to populate it.
– CruleD
yesterday
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
I am not aware of any methods that will do it automatically, so probably with a Loop.
Dim table As New DataTable
table.Columns.Add("date", GetType(Date))
table.Columns.Add("count", GetType(Integer))
table.Columns.Add("name", GetType(String))
For Each Li In Lista_documents
table.Rows.Add(Li("date"), Li("count"), Li("name"))
Next
Adjust depending on how your Lista_documents is structured
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
I am not aware of any methods that will do it automatically, so probably with a Loop.
Dim table As New DataTable
table.Columns.Add("date", GetType(Date))
table.Columns.Add("count", GetType(Integer))
table.Columns.Add("name", GetType(String))
For Each Li In Lista_documents
table.Rows.Add(Li("date"), Li("count"), Li("name"))
Next
Adjust depending on how your Lista_documents is structured
add a comment |
up vote
0
down vote
I am not aware of any methods that will do it automatically, so probably with a Loop.
Dim table As New DataTable
table.Columns.Add("date", GetType(Date))
table.Columns.Add("count", GetType(Integer))
table.Columns.Add("name", GetType(String))
For Each Li In Lista_documents
table.Rows.Add(Li("date"), Li("count"), Li("name"))
Next
Adjust depending on how your Lista_documents is structured
add a comment |
up vote
0
down vote
up vote
0
down vote
I am not aware of any methods that will do it automatically, so probably with a Loop.
Dim table As New DataTable
table.Columns.Add("date", GetType(Date))
table.Columns.Add("count", GetType(Integer))
table.Columns.Add("name", GetType(String))
For Each Li In Lista_documents
table.Rows.Add(Li("date"), Li("count"), Li("name"))
Next
Adjust depending on how your Lista_documents is structured
I am not aware of any methods that will do it automatically, so probably with a Loop.
Dim table As New DataTable
table.Columns.Add("date", GetType(Date))
table.Columns.Add("count", GetType(Integer))
table.Columns.Add("name", GetType(String))
For Each Li In Lista_documents
table.Rows.Add(Li("date"), Li("count"), Li("name"))
Next
Adjust depending on how your Lista_documents is structured
edited yesterday
answered yesterday
Simon Evans
9117
9117
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53237253%2fdeserialized-an-object-into-a-datatable%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
You didn't explain how you want to populate it.
– CruleD
yesterday