Invalid Path ???

Results 1 to 2 of 2

Thread: Invalid Path ???

  1. #1
    Join Date
    Dec 1969

    Default Invalid Path ???

    Hi,<BR><BR>I&#039;m trying to open a csv file on my local drive, then fill the data in the csv file to a dataset. And in-turn, feed that data to a DataGrid. <BR>But I&#039;m getting a strange error which says: <BR>"C:\temp\Test1.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. "<BR>But I when I browse C: emp, there is a csv file called Test1.csv<BR><BR>Can anybody help me why I&#039;m getting this strange error, and help me in getting rid of this error?<BR><BR>Here is the code:<BR>string strconn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\temp\Test1.csv;Extended Properties=\"text;HDR=Yes;FMT=Delimited\"";<BR> OleDbConnection conn = new OleDbConnection(strconn);<BR> conn.Open(); <BR> OleDbDataAdapter newdataadapter = new OleDbDataAdapter("Select * FROM Test1.csv", conn); <BR> DataSet csvdataset = new DataSet();<BR> newdataadapter.Fill(csvdataset, "TheTable"); <BR> DataGrid1.DataSource = "TheTable";<BR> DataGrid1.DataBind();<BR> conn.Close()

  2. #2
    Join Date
    Dec 1969

    Default RE: Invalid Path ???

    &nbsp;<BR>C:\temp\Test1.csv is not a valid path<BR><BR>Could it be the double slash?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts