用npoi组件 将execl的数据读取出来 放到mongodb中就可以了 程序集去这里下载http://npoi.codeplex.com/
using (FileStream fs = File.OpenRead("1.xlsx")) { IWorkbook wk = new XSSFWorkbook(fs); //读取03的xls //IWorkbook wk = new HSSFWorkbook(); //读取07之xlsx for (int i = 0; i < wk.NumberOfSheets; i++) { ISheet sheet = wk.GetSheetAt(i); Console.WriteLine("============{0}==Start============", sheet.SheetName); for (int j = 0; j <= sheet.LastRowNum; j++) { IRow row = sheet.GetRow(j); for (int k = 0; k < row.LastCellNum; k++) { ICell cell = row.GetCell(k); Console.WriteLine(cell.ToString() + "\t"); } } Console.WriteLine("============{0}==End==============", sheet.SheetName); } }