Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2007

Tip: Looking for answers? Try searching our database.

Could not find file Error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Amritha.Datta@gmail.com - 23 Jul 2007 18:29 GMT
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
Patrice - 23 Jul 2007 18:41 GMT
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

> Can anyone tell me why the below code returns error?
> Exception Details: System.IO.FileNotFoundException: Could not find
[quoted text clipped - 15 lines]
>
> Thanks
Amritha.Datta@gmail.com - 23 Jul 2007 19:56 GMT
> Is Deltails in both intentional ?
>
[quoted text clipped - 29 lines]
>
> > 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
Patrice - 24 Jul 2007 08:49 GMT
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

On Jul 23, 1:41 pm, "Patrice" <http://www.chez.com/scribe/> wrote:
> Is Deltails in both intentional ?
>
[quoted text clipped - 31 lines]
>
> > 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
Steve C. Orr [MCSD, MVP, CSM, ASP Insider] - 25 Jul 2007 14:21 GMT
I bet your problem is with permissions.
You may need to adjust the security on that folder to allow the ASPNET (or
NetworkService) user the necessary permissions.
Alternately you could use impersonation to have ASP.NET run under a
different user account:
<!-- Web.config file. -->
<identity impersonate="true" userName="Redmond\BillG" password="Melinda"/>

Signature

I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net

> Can anyone tell me why the below code returns error?
> Exception Details: System.IO.FileNotFoundException: Could not find
[quoted text clipped - 15 lines]
>
> Thanks

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.