Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   delete file failed, The process cannot access the file because it is being used by another process (http://www.velocityreviews.com/forums/t100563-delete-file-failed-the-process-cannot-access-the-file-because-it-is-being-used-by-another-process.html)

guoqi zheng 04-13-2005 02:59 PM

delete file failed, The process cannot access the file because it is being used by another process
 
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

Patrice 04-13-2005 03:45 PM

Re: delete file failed, The process cannot access the file because it is being used by another process
 
Connection pooling get in the way ? Try perhaps to disable connection
pooling in the query string to see if it helps...

Patrice

--

"guoqi zheng" <no@sorry.com> a écrit dans le message de
news:f53bde8446484e7fbbb4e666700f7417@ureader.com. ..
> 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




guoqi zheng 04-13-2005 05:39 PM

Re: delete file failed, The process cannot access the file because it is being used by another process
 
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

vMike 04-13-2005 06:17 PM

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

"guoqi zheng" <no@sorry.com> wrote in message
news:f53bde8446484e7fbbb4e666700f7417@ureader.com. ..
> 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.




All times are GMT. The time now is 10:12 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.