Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

SqlCeEngine.Verify Method

Recalculates the checksums for each page in the database and compares the new checksums to the expected values.

Namespace:  System.Data.SqlServerCe
Assembly:  System.Data.SqlServerCe (in System.Data.SqlServerCe.dll)

public bool Verify()

Return Value

Type: System.Boolean
True if the checksums match and there is no database corruption; otherwise, false.

If this method returns false, the database is corrupt, and your application should call the Repair method to correct the problem.


False is also returned if there is a failure connecting to the database. Scenarios include an incorrect password, or the database file is inaccessible.

SqlCeEngine engine = new SqlCeEngine("Data Source = AdventureWorks.sdf");

if (false == engine.Verify())
    MessageBox.Show("Database is corrupted.");
    engine.Repair(null, RepairOption.RecoverCorruptedRows);

© 2015 Microsoft