Could not find installable ISAM

前端 未结 7 1753
Happy的楠姐
Happy的楠姐 2020-11-28 15:52

I have the following code :

string excelConnectionString = @\"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\\db\\suc.xls; Extended Properties=\"\"Excel 1         


        
7条回答
  •  时光取名叫无心
    2020-11-28 16:39

    // SET A CONNECTION WITH THE EXCEL FILE.

                  OleDbConnection myExcelConn = new OleDbConnection
                      ("Provider=Microsoft.ACE.OLEDB.12.0; " +
                          "Data Source=" + Server.MapPath(".") + "\\" + fileUpload1.FileName +
                          ";Extended Properties='Excel 12.0;HDR=YES'");
    

    Putting Single quote in Extended Properties like Extended Properties ='Excel 12.0:HDR=YES' solved my problem.

提交回复
热议问题