代码如下: 1.获取DataSet 2.转成DataTable 3. public static string DataTableToJson(DataTable dt) { StringBuilder jsonBuilder = new StringBuilder(); //jsonBuilder.Append(“{“); //输出的要求不要’}’ //jsonBuilder.Append(dt.TableName); jsonBuilder.Append(“[“); for (int i = 0; i < dt.Rows.Count; i++) { jsonBuilder.Append(“