leajoy

有很有意思的网站:https://connectionstrings.com/ace-oledb-12-0/  很详细得介绍了各种写法

这里主要提两个:

string strCon = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\'" + excelPath + "\';Extended Properties=\'Excel 8.0;HDR=YES;IMEX=1\'";
string strCon = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\'" + excelPath + "\';Extended Properties=\'Excel 8.0;IMEX=1\'";

这两个适用于97-03版本的excel,后缀.xls

高版本的基本用下面的这个

 string strCon = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\'" + excelPath + "\';Extended Properties=\'Excel 12.0;HDR=YES;IMEX=1\'";

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-12-02
  • 2022-12-23
  • 2021-08-09
  • 2021-06-14
  • 2022-12-23
  • 2021-12-31
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-07
  • 2021-08-20
  • 2022-12-23
  • 2021-12-23
  • 2022-12-23
  • 2021-07-17
相关资源
相似解决方案