this is used by another process while deleting the file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • manojpolawar2008
    New Member
    • Jan 2008
    • 4

    this is used by another process while deleting the file

    Hi ,
    i am using asp.net2.0
    in that DirectoryInfo object for reading the files.
    i have added each file record to DataTable object.
    and bind that to gridview and added one templete field for delete.
    while deleting the image irs showing an error......
    this is used by another process.......s o i am not able to delete that file....
    and dont wan to restart the IIS....

    i have disposed the datatable object......sti ll its not working....
    pls replay with need full information and.... guidance....... .
  • nateraaaa
    Recognized Expert Contributor
    • May 2007
    • 664

    #2
    Originally posted by manojpolawar200 8
    Hi ,
    i am using asp.net2.0
    in that DirectoryInfo object for reading the files.
    i have added each file record to DataTable object.
    and bind that to gridview and added one templete field for delete.
    while deleting the image irs showing an error......
    this is used by another process.......s o i am not able to delete that file....
    and dont wan to restart the IIS....

    i have disposed the datatable object......sti ll its not working....
    pls replay with need full information and.... guidance....... .
    You will need to call Dispose on any object that has access to the file. The file in the datatable is just an in memory representation of the file. Try calling dispose on your DirectoryInfo object.
    Nathan

    Comment

    Working...