复制代码 代码如下:
string fileExt = Path.GetExtension(excelPath);
string conn = "";
if (fileExt == ".xls")
{
conn = "Provider = Microsoft.Jet.OLEDB.4.0 ; Data Source =" + excelPath + ";Extended Properties='Excel 8.0;HDR=Yes;IMEX=1'";
}
else
{
conn = "Provider = Microsoft.ACE.OLEDB.12.0 ; Data Source =" + excelPath + ";Extended Properties='Excel 12.0;HDR=Yes;IMEX=1'";
}
新闻热点
疑难解答