Could not find file Error

  • Thread starter Thread starter Amritha.Datta
  • Start date Start date
A

Amritha.Datta

Can anyone tell me why the below code returns error?
Exception Details: System.IO.FileNotFoundException: Could not find
file

Dim strLFolder As String = "c:\Temp\F Files"
Dim intClientID As Integer = 1221

Dim XMLStr As String = strLFolder & "\" &
intClientID.ToString.Trim & "\Lk\HeaderTrailerDeltails_data.xml"
Dim dsPubs As New DataSet
dsPubs.ReadXml(XMLStr)

where as the below code is working

Dim dsPubs As New DataSet
dsPubs.ReadXml("c:\temp\F Files\1221\Lk
\HeaderTrailerDeltails_data.xml")


Thanks
 
Can anyone tell me why the below code returns error?
Exception Details: System.IO.FileNotFoundException: Could not find
file

Dim strLFolder As String = "c:\Temp\F Files"
Dim intClientID As Integer = 1221

Dim XMLStr As String = strLFolder & "\" &
intClientID.ToString.Trim & "\Lk\HeaderTrailerDeltails_data.xml"
Dim dsPubs As New DataSet
dsPubs.ReadXml(XMLStr)

where as the below code is working

Dim dsPubs As New DataSet
dsPubs.ReadXml("c:\temp\F Files\1221\Lk
\HeaderTrailerDeltails_data.xml")

Thanks

Any response please?
 
if the full path is going to be hardcoded, why bother with all the
concatenation??

Actually full path should not me hard coded in the program. What my
intention was it was working when I hard code and it was not working
when I use concatenations.
 
then something is not translating properly. put in a bunch of message box
statements to examine the values of each part of the string... im sure youll
find something. probably has to do with the integer portion
 
then something is not translating properly. put in a bunch of message box
statements to examine the values of each part of the string... im sure youll
find something. probably has to do with the integer portion

How stupid I am...

I was a spelling mistake. HeaderTrailerDeltails_data.xml
It shud be HeaderTrailerDetails_data.xml

Thanks alot.
 
Back
Top