#把数据库加载到内存
SQLiteConnection cnnIn = new SQLiteConnection("data source=" +dataBaseFileName);
SQLiteConnection SqlMemoryConnection = new SQLiteConnection("Data Source=:memory:");
cnnIn.Open();
SqlMemoryConnection.Open();
cnnIn.BackupDatabase(SqlMemoryConnection, "main", "main", -1, null, -1);
cnnIn.Close();
SqlMemoryConnection,不可关闭,一旦关闭,则数据就没了.
一般把SqlMemoryConnection定义成全局变量.
如果要把SQLite数据保存到磁盘,调整一下顺序就好。