进度条在.net导入Excel时的应用实例(4)

}
        public DataTable ExcelImport(string fileName) //建立Excel表链接,返回Excel表数据
        {
                //EXCEL 的连接串
                string sConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;" +
                "Data Source=C:\\Documents and Settings\\Administrator\\桌面\\" + fileName + ";" +
                "Extended Properties='Excel 8.0;IMEX=1';";
                //string sConnectionString = "Microsoft.ACE.OLEDB.4.0;" +
                //"Data Source=C:\\Documents and Settings\\Administrator\\桌面\\" + fileName + ";" +
                //"Extended Properties='Excel 8.0;IMEX=1';";
                OleDbConnection objConn = new OleDbConnection(sConnectionString);//建立EXCEL的连接

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wjzgsy.html