Поделиться через


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)

Syntax

'Declaration
Public Function Verify As Boolean
'Usage
Dim instance As SqlCeEngine
Dim returnValue As Boolean

returnValue = instance.Verify
public bool Verify ()
public:
bool Verify ()
public boolean Verify ()
public function Verify () : boolean
Not applicable.

Return Value

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

Remarks

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

Example

Dim engine As New SqlCeEngine("Data Source = AdventureWorks.sdf")

If False = engine.Verify() Then
    MessageBox.Show("Database is corrupted.")
    engine.Repair(Nothing, RepairOption.RecoverCorruptedRows)
End If
SqlCeEngine engine = new SqlCeEngine("Data Source = AdventureWorks.sdf");

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

Platforms

Windows CE, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows XP Professional x64 Edition, Windows XP SP2

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Framework

Supported in: 3.0

.NET Compact Framework

Supported in: 2.0

See Also

Reference

SqlCeEngine Class
SqlCeEngine Members
System.Data.SqlServerCe Namespace