System.Data.OleDb.OleDbException: Could not find installable ISAM

后端 未结 3 1360
悲哀的现实
悲哀的现实 2020-12-17 23:20

I have scoured the net, and found many people asking this, yet none have fixed my answer.

I have a Connection Class, and a Method that uses that Class in a page.

3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-17 23:54

    If you use more than 1 extended property then the value tokens must be quoted, otherwise there is no way for the driver to distinguish them from the other non-extended properties in the connection string;

    ...Extended Properties=""Excel 8.0;IMEX=1"""
    

    modify your connection string

    String.Format(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=pricelist.xlsx;Extended Properties=""Excel 12.0 Xml;HDR=YES""");
    

    reference: Could not find installable ISAM

提交回复
热议问题