Hello,
I am trying to import a CSV file into an Dataset in my ASP.NET app. I
get the full path from an HTML input (file) control, and then take the
filename string from that also.
My problem seems to be in the connection string. The error I get when
I try to open the connection is:
'C:\Temp\CredentialingReport.csv' is not a valid path. Make sure that
the path name is spelled correctly and that you are connected to the
server on which the file resides.
The problem is, that it absolutely is a valid path. I select the file
from a browser screen, and take the path from that input.
Here is my code. The error occurs at 'connExcel.Open()' :
connExcel = new
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source='" +
strFilepath + "';Extended
Properties='text;HDR=Yes;FMT=Delimited(,);';");
cmdExcel = new OleDbCommand("SELECT * FROM [" +
strFilename + "]", connExcel);
daExcel = new OleDbDataAdapter(cmdExcel);
connExcel.Open();
I have seen many other people with this problem in my searches around
the 'net, but none have been truly answered... any ideas?
Thanks.