'System.Data.SqlServerCe.RepairOption' does not contain a definition for 'RecoverAllPossibleRows'

112 views Asked by At

I am building a windows app using nant and when runing rebuild command to clean current build and create new assembly files I get the following error in the command prompt: enter image description here

Here's a section of LxSqlCeOprn.cs containing line 85 where error occurs:

using System.Data.SqlServerCe;
public static void RepairDb (string fileSpec, bool delCorruptRows)
        {
            RepairOption opt = delCorruptRows ? RepairOption.DeleteCorruptedRows : RepairOption.RecoverAllPossibleRows;
            //System.Data.SqlServerCe.RepairOption opt = new System.Data.SqlServerCe.RepairOption();
            //opt = delCorruptRows ? RepairOption.DeleteCorruptedRows : RepairOption.RecoverAllPossibleRows;


            try
            {
                LxNformTools.StopService ();
                char[] delimiter = {'.'};
                string[] temp = fileSpec.Split(delimiter);
                string fileBackup = temp[0] + "tempBak." + temp[1];
                File.Copy(fileSpec, fileBackup, true);
                SqlCeEngine engine = GetEngine (fileBackup);
                LxSystemLogger.Log ("Repairing SQL CE database: " +
                                    engine.LocalConnectionString +
                                    "RepairOption=" + opt,
                                    LxSeverity.Info, "LxSqlCeOprn.RepairDb");
                //Attmpt to repair file only if Verify fails
                if(!engine.Verify(VerifyOption.Enhanced))
                {
                    engine.Repair (null, opt);
                    if(engine.Verify(VerifyOption.Enhanced))
                    {
                        File.Copy(fileBackup, fileSpec, true);
                    }
                }
                File.Delete(fileBackup);
                LxSystemLogger.Log ("Repair complete.",
                                    LxSeverity.Success, "LxSqlCeOprn.RepairDb");
            }
            catch (Exception e)
            {
                LxSystemLogger.Log ("Error in database operation", e,
                                    "LxSqlCeOprn.RepairDb");
                if (LxBaseException.IsCriticalException(e))  throw;
            }
            return;
        } // end RepairDb

I am using visual studio professional 2013, the reference to System.Data.SqlServerCe.dll has been added to the project and Visual Studio does not complain about any missing definitions. I was thinking this could be related to environment setup, any hints will be appreciated.

0

There are 0 answers