public VolumeDatabase(string dbPath, bool create) { if (dbPath == null) { throw new ArgumentNullException("dbPath"); } disposed = false; sql = new SqlBackend(dbPath, create, this); searchItemResultsLimit = -1; if (create) { CreateTables(); } else { int version = GetDBProperties().Version; if (version != DB_VERSION) { sql.Close(); throw new UnsupportedDbVersionException(string.Format("Found version {0}, expected version is {1}", version, DB_VERSION)); } } }
private void Dispose(bool disposing) { if (!disposed) { if (disposing) { if (!sql.IsClosed) { sql.Close(); } } sql = null; } disposed = true; }