How to convert json into datatable?

前端 未结 5 727
暗喜
暗喜 2020-11-27 21:17

Does anyone know how to convert a json string into DataTable from asp.net? I came to know about the Deserialize, it needs the class, I just want the datatable as returned. C

5条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-27 21:56

    It´s simple.

    If you are in framework 2.0, you must import json.net (http://json.codeplex.com/) in your project, if your framework is superior, it has json.

    The code in vb.net framework 2.0:

    Dim Table DataTable
    
    Table = Json.JsonConvert.DeserializeObject(Of DataTable)(Json_string)
    

    That´s all.

提交回复
热议问题