c# - Delete sqlite database file in .net environment -


i'm doing integration tests of software uses sqlite.

the software needs use database file prevent data being lost. after each of tests, want delete database file leave @ beginning.

the problem when try delete file throws exception says "system.io.ioexception: process cannot access file '*****' because being used process". before trying delete file, i'm closing , disposing of connection this:

if(_connection.state == system.data.connectionstate.open) _connection.close(); _connection.dispose(); 

to delete file using instruction: file.delete(_databasefilepath); doing wrong?, miss something? in advance.


Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -