I have a compact pc program that uses a sql server database (sdf file).
I want to check the database integrity when program starts so I added a call to veriy method of SqlCeEngine.
The verify function always returns false even the database is OK and I can work with it.
when I call repair it throws the exception : "The specified module could not be found"
The code is :
string connectionString = "Data Source = '"
+ m_dbFullName + "'";SqlCeEngine engine = newSqlCeEngine(connectionString);if(engine.Verify() == false){
engine.Repair(null, RepairOption.RecoverCorruptedRows);
}
The database exists and the path to it is correct:
dbFullName = "\\program files\\MyApp\\MyDB.sdf"
I also tried out some different connection strings but it did not help:
"Data Source = ' MyDB.sdf '"
"Data Source = 'MyDB.sdf "
"Data Source=' MyDB.sdf '"
"Data Source=MyDB.sdf"
Please any one can help me with this ???????????????????