Collapse All Expand All Code: All Code: Multiple Code: C# Code: Visual Basic Code: Visual C++

C#
Visual Basic
Visual C++

Berkeley DB .NET API Documentation
Database..::.PutNoOverwrite Method (DatabaseEntry, DatabaseEntry)
Database Class See Also Send Feedback

Store the key/data pair in the database, only if the key does not already appear in the database.

Namespace: BerkeleyDB
Assembly: libdb_dotnet181 (in libdb_dotnet181.dll) Version: 18.1.32.0

# Syntax

C#
    public void PutNoOverwrite(
    	DatabaseEntry key,
    	DatabaseEntry data
    )

Visual Basic (Declaration)
    Public Sub PutNoOverwrite ( _
    	key As DatabaseEntry, _
    	data As DatabaseEntry _
    )

Visual C++
    public:
    void PutNoOverwrite(
    	DatabaseEntry^ key,
    	DatabaseEntry^ data
    )

#### Parameters

key
  Type: BerkeleyDB..::.DatabaseEntry
  The key to store in the database

data
  Type: BerkeleyDB..::.DatabaseEntry
  The data item to store in the database

# Remarks

This enforcement of uniqueness of keys applies only to the primary key, the behavior of insertions into secondary databases is not affected. In particular, the insertion of a record that would result in the creation of a duplicate key in a secondary database that allows duplicates would not be prevented by the use of this flag.

# See Also

Database Class
PutNoOverwrite Overload
BerkeleyDB Namespace