如果我们无法访问引擎,如何在 WP7 中验证数据库的状态?
本质上,此代码的电话等效项是什么:
public void VerificarFileBD()
{
try
{
var engine = new SqlCeEngine("Data Source = AdventureWorks.sdf");
if (false == engine.Verify())
{
MessageBox.Show("Database is corrupted.");
engine.Repair(null, RepairOption.RecoverCorruptedRows);
}
}
catch (Exception)
{
throw;
}
}