代码如下: public class JsonUtil { public string ToJson(DataSet dataSet) { string jsonString = “{“; foreach (DataTable table in dataSet.Tables) { jsonString += “”” + table.TableName + “”:” + ToJson(table) + “,”; } jsonString = jsonString.TrimEnd(‘,’); ret