Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > delete file failed, The process cannot access the file because it is being used by another process

Reply
Thread Tools

delete file failed, The process cannot access the file because it is being used by another process

 
 
guoqi zheng
Guest
Posts: n/a
 
      04-13-2005
Dear sir,

There is an import tool on my web application, user can upload Ms Access
file, the file is saved at a temp folder on the server. After the import is
finished, for security reason, I need to delete the imported Ms Access file,
however, I always get above error, "The process cannot access the file
because it is being used by another process"

I did close the datareader and connection object. What else can I do to
delete this file???????

regards,

Guoqi Zheng
http://www.ureader.com
 
Reply With Quote
 
 
 
 
Patrice
Guest
Posts: n/a
 
      04-13-2005
Connection pooling get in the way ? Try perhaps to disable connection
pooling in the query string to see if it helps...

Patrice

--

"guoqi zheng" <(E-Mail Removed)> a écrit dans le message de
news:(E-Mail Removed). ..
> Dear sir,
>
> There is an import tool on my web application, user can upload Ms Access
> file, the file is saved at a temp folder on the server. After the import

is
> finished, for security reason, I need to delete the imported Ms Access

file,
> however, I always get above error, "The process cannot access the file
> because it is being used by another process"
>
> I did close the datareader and connection object. What else can I do to
> delete this file???????
>
> regards,
>
> Guoqi Zheng
> http://www.ureader.com



 
Reply With Quote
 
 
 
 
guoqi zheng
Guest
Posts: n/a
 
      04-13-2005
How can I disable connection pooling?

I add pooling=false in the connection string, then I got "Could not find
installable ISAM." error


regards,

Guoqi Zheng
http://www.ureader.com
 
Reply With Quote
 
vMike
Guest
Posts: n/a
 
      04-13-2005

"guoqi zheng" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed). ..
> Dear sir,
>
> There is an import tool on my web application, user can upload Ms Access
> file, the file is saved at a temp folder on the server. After the import

is
> finished, for security reason, I need to delete the imported Ms Access

file,
> however, I always get above error, "The process cannot access the file
> because it is being used by another process"
>
> I did close the datareader and connection object. What else can I do to
> delete this file???????
>
> regards,
>
> Guoqi Zheng
> http://www.ureader.com


Make sure you also close the stream that holds the imported file once you
have written it out. (assuming that is how your are writing to the temp
folder). If you open the temp file to copy it or move it, make sure you are
closing that too. File operations are not managed by .net in many cases.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot delete a file the process cannot access the file because it is being used by another process ASp.net 2 ary ASP .Net 2 11-29-2006 04:30 AM
Cannot delete a file the process cannot access the file because it is being used by another process ASp.net 2 ary ASP .Net 0 11-28-2006 09:13 AM
Process Cannot access file "file_name" because it is being used by another process Rithesh Pai ASP .Net 1 08-22-2005 03:02 PM
Cannot Copy Assembly <MyAssembly> The Process Cannot Access The File Because It Is Being Used By Another Process Ram ASP .Net 2 06-30-2005 11:30 AM
The process cannot access the file because it is being used by another process. Jerry ASP .Net 4 12-15-2003 06:07 PM



Advertisments