c# reading csv file gives not a valid path

前端 未结 7 1888
Happy的楠姐
Happy的楠姐 2020-12-05 07:04

I can\'t seem to read a .csv file using the following connection string:

var fileName = string.Format(\"{0}{1}\", AppDomain.CurrentDomain.BaseDirectory, \"Up         


        
7条回答
  •  离开以前
    2020-12-05 07:38

    I had the same problem a few weeks ago trying to do some Office 2007 automation and spent too much time trying to fix it.

    string connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + fileName + ";Extended Properties=\"Excel 12.0;HDR=YES;IMEX=1;\"";
    

提交回复
热议问题