EXCEL 连接字符串

 string strConn = "";
            if (extension == ".xlsx")
            {
                strConn = "Provider=Microsoft.Ace.OleDb.12.0;Data Source='" + excelPath + "';Extended Properties='Excel 12.0;IMEX=1'";          // 07+
            }
            else if (extension == ".xls")
            {
                strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='" + excelPath + "';Extended Properties='Excel 8.0;IMEX=1'";    //03
            }

本文来自博客园,作者:mushishi,转载请注明原文链接:https://www.cnblogs.com/mushishi/archive/2013/06/13/3133434.html

原文地址:https://www.cnblogs.com/mushishi/p/3133434.html