![]() |
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 |
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 |
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 |
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.