.cs文件直接贴代码: using System; using System.Collections.Generic; using System.Data; using System.IO; using System.Linq; using System.Text; using System.Web; using System.Web.UI; public class DataToCsv { public DataToCsv() { } /// <summary> /// 将DataTable…
导出到json: $ mongoexport.exe -d TestDB -c TestCollection -o ./test.json 导出到csv: If you want to output CSV, you have to specify the fields in the order you want them. $ mongoexport.exe --csv -f _id,f1,f2,f3,f4,f5,f6,f7 -d TestDB -c TestCollection -o…
一.自动输出中文字符集 select * from db into outfile 'test.csv' CHARACTER SET gbk fields terminated by ',' optionally enclosed by '"' escaped by '"' lines terminated by '\r\n'; 二.导出后转换字符集 转换成CSV文件,如果乱码将CSV已记事本打开另存为UTF8 select * from db into outfile 'test.c…