Toxy is another project promoted after NPOI. It aims to solve the document extraction problem. It supports all docx, xlsx, xls, csv, and vcard formats. The following is a simple but useful example.ParserContext c = new ParserContext (@ "d: \ demo.xls"); var parser = ParserFactory. createSpreadsheet (c); var spreadsheet = parser. parse (); DataSet ds = spreadsheet. toDataSet ();
Here is the legendary code that can directly convert an Excel Workbook into a DataSet! CreateSpreadsheet supports xls and xlsx, so you do not need to worry about this issue. In addition to converting Workbook to DataSet, Toxy also supports converting a table in Excel into a DataTable, because ToxyTable has a method called ToDataTable, and ToxySpreadsheet (equivalent to Excel workbook) it can contain multiple toxytables. With Toxy, it is easier to extract Excel data! References
Official website: toxy.codeplex.com
Http://blog.sina.com.cn/s/blog_701d1da40101h66g.htmlhttp://blog.sina.com.cn/s/blog_701d1da40101gi6m.html
4 sentences of code read from Excel to DataSet (non-Excel component)