Collapse All Expand All Code: All Code: Multiple Code: C# Code: Visual Basic Code: Visual C++ Members: Show All Members: Filtered Members: Filtered Members: Filtered

C#
Visual Basic
Visual C++
Include Protected Members
Include Inherited Members

Berkeley DB .NET API Documentation
Database Methods
Database Class See Also Send Feedback

The Database type exposes the following members.

# Methods

| Name | Description
--- | --- | ---
| Close | Overloaded. Although closing a database also closes any open cursors, it is recommended that applications explicitly close all their Cursor objects before closing the database. The reason why is that when the cursor is explicitly closed, the memory allocated for it is reclaimed; however, this does not happen if you close a database while cursors are still opened. The same rule, for the same reasons, holds true for Transaction objects. Simply make sure you resolve all your transaction objects before closing your database handle. Because key/data pairs are cached in-memory, applications should make a point to always either close database handles or sync their data to disk (using Sync()()() before exiting, to ensure that any data cached in main memory is reflected in the underlying file system. When called on a secondary index's primary database, the primary should be closed only after all secondary indices referencing it have been closed. When multiple threads use the object concurrently, only a single thread may call the Close method. The object may not be accessed again after Close is called, regardless of its outcome.
| Convert | Convert all of the databases included in the file file to the byte order use_big_endian, if necessary. If no conversion is necessary, Convert always returns successfully. If the database is partitioned, cfg must contain the correct partition configuration in order to convert database partitions.
| Cursor | Overloaded.
| Delete | Overloaded.
| Dispose | Release the resources held by this object, and close the database if it is still open. (Inherited from BaseDatabase.)
| Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
| Exists | Overloaded.
| Get | Overloaded.
| GetBoth | Overloaded.
| GetBothMultiple | Overloaded.
| GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
| GetMultiple | Overloaded.
| GetType | Gets the Type of the current instance. (Inherited from Object.)
| Join | Create a specialized join cursor for use in performing equality or natural joins on secondary indices.
| Open | Overloaded.
| PrintFastStats | Overloaded. The statistical information is described by the BTreeStats, HashStats, HeapStats, QueueStats, and RecnoStats classes.
| PrintStats | Overloaded. The statistical information is described by the BTreeStats, HashStats, HeapStats, QueueStats, and RecnoStats classes.
| Put | Overloaded. If the database supports duplicates, add the new data value at the end of the duplicate set. If the database supports sorted duplicates, the new data value is inserted at the correct sorted location.
| PutNoOverwrite | Overloaded.
| Salvage | Overloaded.
| Sync | Flush any cached information to disk. (Inherited from BaseDatabase.)
| ToString | Returns a String that represents the current Object. (Inherited from Object.)
| Truncate | Overloaded. When called on a database configured with secondary indices, This method truncates the primary database and all secondary indices. A count of the records discarded from the primary database is returned.
| Upgrade | Overloaded. Database upgrades are done in place and are destructive. For example, if pages need to be allocated and no disk space is available, the database may be left corrupted. Backups should be made before databases are upgraded. See Upgrading databases in the Programmer's Reference Guide for more information.
| Verify | Overloaded. Verify does not perform any locking, even in Berkeley DB environments that are configured with a locking subsystem. As such, it should only be used on files that are not being modified by another thread of control.

# See Also

Database Class
BerkeleyDB Namespace