net中导入2013excel的故障解决办法。
修改导入excel的连接字符串
string strCon = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + filepath + ";Extended Properties=‘Excel 12.0;IMEX=1‘";
2010版本前的导入字符串是
string strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filepath + ";Extended Properties=‘Excel 8.0;IMEX=1‘";
时间: 2024-12-19 14:14:09