public static string CreateJsonParameters(DataTable dt) { /* /**************************************************************************** * Without goingin to the depth of the functioning of this Method, i will try to g
using System; using System.Data; using System.Linq; using System.Collections; using System.Collections.Generic; using System.Web.Script.Serialization; namespace *** { public class DatatableToJson { #region DataTable --> Json 字符串 /// <summary> ///
1.这里下载:http://www.newtonsoft.com/products/json/ 安装: 1.解压下载文件,得到Newtonsoft.Json.dll 2.在项目中添加引用 2.引入命名空间 using Newtonsoft.Json; using Newtonsoft.Json.Converters; 3.把datatable转换成json格式 public string GetAllCategory() { string result = ""; Data