Directory not being released by process
I am creating a database connection to a .dbf file which is stored in a temp directory.
I open the connection and read from it using an OdbcDataAdapter object. Then I close the adapter and the connection.
When i try to then delete my temp dir named "128190509005573176" I get the following error/exception:
================================================== =================
The process cannot access the file 'C:\CARSMnet\bin\tmp\128190509005573176\' because it is being used by another process.
================================================== =================
Why won't the directory be released? It lets me delete the actual ".dbf" file i was working with but won't let me kill the parent dir.
Help?!?!?!
Here's my code:
OdbcConnection connection = new OdbcConnection(@"Driver={Microsoft dBase Driver (*.dbf)};DBQ=" + sTmpDirPath);
OdbcDataAdapter adapter = new OdbcDataAdapter("Select * from " + sTmpDirPath + "daox.dbf", connection);
System.Data.DataSet dataSet = new DataSet();
connection.Open();
adapter.Fill(dataSet);
connection.Close();
|