I'm using SQLite3 database for a small level system. The problem is that when I try to rename the db file using IO file system, System.IO returns an exception that the file is being used by another process however I've already closed the connection using connection.Close() method. I searched on this topic but cold not find any thing useful for me. Someone please suggest me the right way to release an SQLite connection..
Thanks in Advance
One of the things I learned programming with SQLite is that closing the connection is simply not good enough. You need to wrap everything in a
usingblock. Make sure yourSQLiteConnectionobject is wrapped in ausingblock, yourSQLiteCommandis wrapped in ausingblock and yourSQLiteDataReaderis wrapped in ausingblock. Your code should look similar to this: