473,396 Members | 1,966 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Could not find file Error

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

Jul 23 '07 #1
3 3691
Is Deltails in both intentional ?

My approach would be to read the directory content using DirectoryInfo and
do a char by char comparison to get the first mismatch char so that this is
my computer that works to find the difference (for example you could have a
non secable white space character that would be near impossible to find by
just looking).

--
Patrice

<Am***********@gmail.coma écrit dans le message de news:
11*********************@k79g2000hse.googlegroups.c om...
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

Jul 23 '07 #2
On Jul 23, 1:41 pm, "Patrice" <http://www.chez.com/scribe/wrote:
Is Deltails in both intentional ?

My approach would be to read the directory content using DirectoryInfo and
do a char by char comparison to get the first mismatch char so that this is
my computer that works to find the difference (for example you could havea
non secable white space character that would be near impossible to find by
just looking).

--
Patrice

<Amritha.Da...@gmail.coma écrit dans le message de news:
1185211752.563657.16...@k79g2000hse.googlegroups.c om...
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
The directory is valid and existing in the hard disk.
The problem is why it is throwing error if I use the first method?

I will have to use the first method because that enable me to get
different clientID values dynamically in the program.

Thanks

Jul 23 '07 #3
I don't see any obvious reason but my first assumption would be that this is
for some legitimate reason. So once again I would code a file name
comparision to make sure that there is no mismatch in particular regarding
white spaces that are almost uncheckable by just looking at them. Have you
tried what I have suggested ?

Also what if you try both code you submitted but using a single variable
that contains the file name (this way you are 100% sure that both file name
are the same) ?

Etc....
--
Patrice

<Am***********@gmail.coma écrit dans le message de news:
11**********************@d55g2000hsg.googlegroups. com...
On Jul 23, 1:41 pm, "Patrice" <http://www.chez.com/scribe/wrote:
Is Deltails in both intentional ?

My approach would be to read the directory content using DirectoryInfo and
do a char by char comparison to get the first mismatch char so that this
is
my computer that works to find the difference (for example you could have
a
non secable white space character that would be near impossible to find by
just looking).

--
Patrice

<Amritha.Da...@gmail.coma écrit dans le message de news:
1185211752.563657.16...@k79g2000hse.googlegroups.c om...
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
The directory is valid and existing in the hard disk.
The problem is why it is throwing error if I use the first method?

I will have to use the first method because that enable me to get
different clientID values dynamically in the program.

Thanks
Jul 24 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Koen | last post by:
Hi all, I created a little database to manage my e-books. The program will synchronize a table with the contents of a directory. Works great. Because I keep additional info (like keywords) to...
6
by: Robert Lawson | last post by:
I continue to get the below error message when trying to load a aspx file. Could someone please point me in the right direction for solving this? I'm trying to access an access data base and I'm...
0
by: Rob Dob | last post by:
Hi, I have a VS2003 C# asp.net project that has been converted into a VS2005 project. Everything seemed to work well until I make a modification to anything within the Component Designer...
2
by: Eric Falsken | last post by:
Eric Falsken <eric@db4o.com> wrote on 04 Dec 2005: > craigkenisston@hotmail.com wrote on 19 Nov 2005: > >> I'm working in the migration of an asp.net application in 1.1 to 2.0. >> I'm new to...
1
by: ddelaney | last post by:
I've seen this posted before in many places, but have yet to find a real fix. I have a web application on dev server right now, and randomly, hours or days, it returns the expception posted below. ...
2
by: antonyliu2002 | last post by:
I am testing AJAX. I've downloaded the AJAX Extension and the CTP December package and installed on BOTH my development machine and the production server. Then I created a very very simple web...
2
by: jjlagtap | last post by:
Hey everyone When I try to open a file i get the Exception listed below. The weird thing is it works when I run the web app locally and when i use a remote server and open a file on my computer....
3
by: pratikkagda | last post by:
Hi all, My system contains Framework 3.5 with visual studio 2008 as well as 2005; here I have developed an application with crystal report with framework 2.0. It is working great in my system but...
3
by: Lance Wynn | last post by:
Hello, I am receiving this error when trying to instantiate a webservice component. I have 2 development machines, both are XP sp2 with VS 2008 installed. On one machine, the code works fine. On...
11
by: fniles | last post by:
One of our application uses VB6 and Access97 database. Another application uses VB.NET 2005. This morning for about 15 seconds when the application tries to read either a query or a table from the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.