SQLite in-memory database backup in .NET

Omkar picture Omkar · Feb 3, 2011 · Viewed 19.6k times · Source

How to get the SQLite in-memory data base backed up? I create the database in my Windows application. I want to take a database backup when I will close the application.

Answer

Corbin March picture Corbin March · Feb 3, 2011

You want the SQLite Online Backup API.

As far as I know, System.Data.SQLite does not support it yet, so you'll need to write some code. The System.Data.SQLite Forum contains an example: http://sqlite.phxsoftware.com/forums/t/2403.aspx. As noted, when you patch System.Data.SQLite and call SQLite directly you do so at your own risk.