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..::.Salvage Method (String, DatabaseConfig, Boolean, Boolean, TextWriter)
Database Class See Also Send Feedback

Write the key/data pairs from all databases in the file to OutputStream. Key values are written for Btree, Hash and Queue databases, but not for Recno databases.

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

# Syntax

C#
    public static void Salvage(
    	string file,
    	DatabaseConfig cfg,
    	bool Printable,
    	bool Aggressive,
    	TextWriter OutputStream
    )

Visual Basic (Declaration)
    Public Shared Sub Salvage ( _
    	file As String, _
    	cfg As DatabaseConfig, _
    	Printable As Boolean, _
    	Aggressive As Boolean, _
    	OutputStream As TextWriter _
    )

Visual C++
    public:
    static void Salvage(
    	String^ file,
    	DatabaseConfig^ cfg,
    	bool Printable,
    	bool Aggressive,
    	TextWriter^ OutputStream
    )

#### Parameters

file
  Type: System..::.String
  The physical file in which the databases to be salvaged are found.

cfg
  Type: BerkeleyDB..::.DatabaseConfig
  Configuration parameters for the databases to be salvaged.

Printable
  Type: System..::.Boolean
  If true and characters in either the key or data items are printing characters (as defined by isprint(3)), use printing characters to represent them. This setting permits users to use standard text editors and tools to modify the contents of databases or selectively remove data from salvager output.

Aggressive
  Type: System..::.Boolean
  If true, output all the key/data pairs found in the file. Corruption of these data pairs is assumed, and corrupted or deleted data pairs may appear in the output (even if the salvaged file is in no way corrupt). This output almost certainly requires editing before being loaded into a database.

OutputStream
  Type: System.IO..::.TextWriter
  The TextWriter to which the databases' key/data pairs are written. If null, Out is used.

# See Also

Database Class
Salvage Overload
BerkeleyDB Namespace