tab 1
此 demo 展示如何读取 excel 数据并导出到 datatable。
如果这不是您想要的 demo,您可以通过填写表格获取免费定制 demo。
如您有与我们产品相关的其他技术问题,请联系 该email地址已收到反垃圾邮件插件保护。要显示它您需要在浏览器中启用javascript。;销售相关的问题,请联系 该email地址已收到反垃圾邮件插件保护。要显示它您需要在浏览器中启用javascript。。
tab 2
using system.data;
using spire.xls;
namespace demoonlinecode
{
class importdatafromexceltodatatable
{
public void demoimportdatafromexceltodatatable(string filepath,string resultfilepath)
{
workbook book = new workbook();
book.loadfromfile(filepath);
datatable table = book.worksheets[0].exportdatatable();
workbook data_book = new workbook();
data_book.worksheets[0].insertdatatable(table,true,1,1);
data_book.savetofile(resultfilepath,excelversion.version2010);
}
}
}
tab 3
imports system.data
imports spire.xls
namespace demoonlinecode
class importdatafromexceltodatatable
public sub demoimportdatafromexceltodatatable(filepath as string, resultfilepath as string)
dim book as new workbook()
book.loadfromfile(filepath)
dim table as datatable = book.worksheets(0).exportdatatable()
dim data_book as new workbook()
data_book.worksheets(0).insertdatatable(table, true, 1, 1)
data_book.savetofile(resultfilepath, excelversion.version2010)
end sub
end class
end namespace