Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 4729

Error using Verify/Repair methods of SqlCeEngine

$
0
0

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 ???????????????????


Viewing all articles
Browse latest Browse all 4729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>