NPOI导入导出Excel

时间:2021-09-17 08:55:58
【文件属性】:
文件名称:NPOI导入导出Excel
文件大小:4.2MB
文件格式:RAR
更新时间:2021-09-17 08:55:58
NPOI导入导出 导入导出 支持NPOI导入导出Excel表格中 using System.Collections.Generic; using System.Data; using System.IO; using System.Linq; using NPOI.HSSF.UserModel; using NPOI.SS.UserModel; using NPOI.XSSF.UserModel; public static DataTable GetDataTable(string filepath) { var dt = new DataTable("xls"); if (filepath.Last()=='s') { dt = x2003.ExcelToTableForXLS(filepath); } else { dt = x2007.ExcelToTableForXLSX(filepath); } return dt; }

网友评论