Пример #1
0
        /// <summary>
        /// Deletes the database.
        /// </summary>
        public void Dispose()
        {
            var filePath = new FileInfo(dataSourcePath);

            if (!filePath.Exists)
            {
                return;
            }
            sharedConnection.Dispose();
            sqLiteConnection.Dispose();
            SQLiteConnection.ClearAllPools();

            // SQLite requires all created sql connection/command objects to be disposed
            // in order to delete the database file
            GC.Collect(2, GCCollectionMode.Forced);
            System.Threading.Thread.Sleep(100);

            File.Delete(dataSourcePath);
        }