(6)DataTable 转换成 Json

下载  Json.Net DLL      http://www.newtonsoft.com/json    需要翻墙

using Newtonsoft.Json;
 
public string DataTableToJsonWithJsonNet(DataTable table)
   { 
    string JsonString=string.Empty; 
    JsonString = JsonConvert.SerializeObject(table); 
    return JsonString; 

或者在vs内部直接搜索Json安装,   需要翻墙

 

原文地址:https://www.cnblogs.com/buchizaodian/p/7047340.html