I am trying move to file from one folder to another folder after importing data getting error as below :
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> System.IO.IOException: The process cannot access the file because it is being used by another process.
Please help me , Thanks in advance.
Thanks and Regards,
It is excel(CSV) file.
Thanks for your earlier reply.
Which class you are using to import the data? If possible please show us the code…
I am writing code as below :
Probably you are not closing the Excel after reading the data.
Is that a single class to read the data and move the file and are you running it on the client ?
Thank you very much for your reply, I am writing line after importing data as below , I am developing one class for both process (Importing and moving file)
I tried running on the client and sever but same error .