🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
## 1、datatable返回常规json ``` /// <summary> /// DataTable 转Json By 朱光明 /// </summary> /// <param name="dt">DataTable</param> /// <returns></returns> public static string DataTableToJSON(DataTable dt) { string jsonStr = JsonConvert.SerializeObject(dt); dt.Clear(); return jsonStr; } ``` ## 用法 ``` dt = SqlEasy.ExecuteDataTable("select * from sys_users where keyid=@KeyId", paras); Response.Write(JSONhelper.DataTableToJSON(dt)); ```