public void TestMethod2() { var svc = new XBD.Service.NarcoticsSvc(); var filePath = AppDomain.CurrentDomain.BaseDirectory + "/Files/危险化学品名录统计表3.xls"; var dt = ExcelTool.ToDataTable(filePath); svc.AddAll(dt); Assert.IsTrue(1 == 1); }
private DataTable LoadFile(string filename) { try { ExcelTool xls = new ExcelTool(filename); xls.SetDriver("NPOI"); return(xls.ToDataTable()); } catch (Exception ex) { MessageBox.Show(ex.Message); } return(null); }