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

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -