Get data from a JSON into a datatable.

Get data from a JSON into a datatable.

bartdereubartdereu Posts: 10Questions: 5Answers: 0

Hi All,

i'm working on a ASP MVC site that has a controller that returns JSON in the following format :

{"Id":1,"Email":"myemail@provider.com"},{"Id":2,"Email":"myemail@provider.com"},

i want to ge this into a datatable but i seem to be stuck all the way. Is there a way to get this datasource
directly into the table? Or any examples?

it would help me allot ! thanx !

Answers

  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin

    What you have posted isn't valid JSON. I assume that you actually have an array of objects.

    If so, look at this example which shows how it can be done.

    Allan

  • bartdereubartdereu Posts: 10Questions: 5Answers: 0

    Correct, Allan. Thank you

This discussion has been closed.