Repairs a corrupted database.
Assembly: System.Data.SqlServerCe (in System.Data.SqlServerCe.dll)
There are 4 values of RepairOption that can be used to repair the corrupted database:
RecoverCorruptedRows: This option is deprecated, as it does not ensure that the recovered data is free from corruption. You should use RecoverAllOrFail.
In SQL Server Compact 4.0, you can use this method to create a repaired database with a case-sensitive collation. If you set the connection string property CaseSensitive to false in the Repair method, for a case sensitive database, if the database contains a case sensitive index, the loss of case sensitivity can cause an index error in the repair log even though the code runs successfully. The error occurs when two unique records are treated as equal. Two example values are 'aaa' and 'aaA'. The following message is written to the repair log file: Failed to create index