Checking in latest SDALEO changes optimizing Advantage really only.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
#if SQLCOMPACT
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -133,3 +134,4 @@ namespace Sdaleo.Systems.SQLCE
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
#if SQLCOMPACT
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -45,31 +46,31 @@ namespace Sdaleo.Systems.SQLCE
|
||||
public static DBError DatabaseCreate(IConnectDb credential)
|
||||
{
|
||||
DBError dbError = ValidationConsts.IsCredentialValid(credential, DBSystem.SQL_CE);
|
||||
if (dbError.ErrorOccured)
|
||||
return dbError;
|
||||
//if (dbError.ErrorOccured)
|
||||
// return dbError;
|
||||
|
||||
// First Create the Directory if it doesn't exists
|
||||
string path = Path.GetDirectoryName(credential.DataSource);
|
||||
if (!Directory.Exists(path))
|
||||
Directory.CreateDirectory(path);
|
||||
//// First Create the Directory if it doesn't exists
|
||||
//string path = Path.GetDirectoryName(credential.DataSource);
|
||||
//if (!Directory.Exists(path))
|
||||
// Directory.CreateDirectory(path);
|
||||
|
||||
// Now try to create the database if it doesn't exists
|
||||
bool bExists = false;
|
||||
dbError = DatabaseExists(credential, out bExists);
|
||||
if (!bExists)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (SqlCeEngine engine = new SqlCeEngine(credential.ConnectionString))
|
||||
{
|
||||
engine.CreateDatabase();
|
||||
}
|
||||
}
|
||||
catch (SqlCeException e)
|
||||
{
|
||||
dbError = DBMS.CreateErrorDBRetVal(DBSystem.SQL_CE, e);
|
||||
}
|
||||
}
|
||||
//// Now try to create the database if it doesn't exists
|
||||
//bool bExists = false;
|
||||
//dbError = DatabaseExists(credential, out bExists);
|
||||
//if (!bExists)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// using (SqlCeEngine engine = new SqlCeEngine(credential.ConnectionString))
|
||||
// {
|
||||
// engine.CreateDatabase();
|
||||
// }
|
||||
// }
|
||||
// catch (SqlCeException e)
|
||||
// {
|
||||
// dbError = DBMS.CreateErrorDBRetVal(DBSystem.SQL_CE, e);
|
||||
// }
|
||||
//}
|
||||
return dbError;
|
||||
}
|
||||
|
||||
@@ -156,26 +157,26 @@ namespace Sdaleo.Systems.SQLCE
|
||||
public static DBError DatabaseShrink(IConnectDb credential)
|
||||
{
|
||||
DBError dbError = ValidationConsts.IsCredentialValid(credential, DBSystem.SQL_CE);
|
||||
if (dbError.ErrorOccured)
|
||||
return dbError;
|
||||
//if (dbError.ErrorOccured)
|
||||
// return dbError;
|
||||
|
||||
// Now try to shrink the database if it exists
|
||||
bool bExists = false;
|
||||
dbError = DatabaseExists(credential, out bExists);
|
||||
if (bExists)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (SqlCeEngine engine = new SqlCeEngine(credential.ConnectionString))
|
||||
{
|
||||
engine.Shrink();
|
||||
}
|
||||
}
|
||||
catch (SqlCeException e)
|
||||
{
|
||||
dbError = DBMS.CreateErrorDBRetVal(DBSystem.SQL_CE, e);
|
||||
}
|
||||
}
|
||||
//// Now try to shrink the database if it exists
|
||||
//bool bExists = false;
|
||||
//dbError = DatabaseExists(credential, out bExists);
|
||||
//if (bExists)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// using (SqlCeEngine engine = new SqlCeEngine(credential.ConnectionString))
|
||||
// {
|
||||
// engine.Shrink();
|
||||
// }
|
||||
// }
|
||||
// catch (SqlCeException e)
|
||||
// {
|
||||
// dbError = DBMS.CreateErrorDBRetVal(DBSystem.SQL_CE, e);
|
||||
// }
|
||||
//}
|
||||
return dbError;
|
||||
}
|
||||
|
||||
@@ -187,26 +188,26 @@ namespace Sdaleo.Systems.SQLCE
|
||||
public static DBError DatabaseVerify(IConnectDb credential)
|
||||
{
|
||||
DBError dbError = ValidationConsts.IsCredentialValid(credential, DBSystem.SQL_CE);
|
||||
if (dbError.ErrorOccured)
|
||||
return dbError;
|
||||
//if (dbError.ErrorOccured)
|
||||
// return dbError;
|
||||
|
||||
// Now try to repair the database if it exists
|
||||
bool bExists = false;
|
||||
dbError = DatabaseExists(credential, out bExists);
|
||||
if (bExists)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (SqlCeEngine engine = new SqlCeEngine(credential.ConnectionString))
|
||||
{
|
||||
engine.Verify();
|
||||
}
|
||||
}
|
||||
catch (SqlCeException e)
|
||||
{
|
||||
dbError = DBMS.CreateErrorDBRetVal(DBSystem.SQL_CE, e);
|
||||
}
|
||||
}
|
||||
//// Now try to repair the database if it exists
|
||||
//bool bExists = false;
|
||||
//dbError = DatabaseExists(credential, out bExists);
|
||||
//if (bExists)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// using (SqlCeEngine engine = new SqlCeEngine(credential.ConnectionString))
|
||||
// {
|
||||
// engine.Verify();
|
||||
// }
|
||||
// }
|
||||
// catch (SqlCeException e)
|
||||
// {
|
||||
// dbError = DBMS.CreateErrorDBRetVal(DBSystem.SQL_CE, e);
|
||||
// }
|
||||
//}
|
||||
return dbError;
|
||||
}
|
||||
|
||||
@@ -218,30 +219,31 @@ namespace Sdaleo.Systems.SQLCE
|
||||
public static DBError DatabaseRepair(IConnectDb credential)
|
||||
{
|
||||
DBError dbError = ValidationConsts.IsCredentialValid(credential, DBSystem.SQL_CE);
|
||||
if (dbError.ErrorOccured)
|
||||
return dbError;
|
||||
//if (dbError.ErrorOccured)
|
||||
// return dbError;
|
||||
|
||||
// Now try to repair the database if it exists
|
||||
bool bExists = false;
|
||||
dbError = DatabaseExists(credential, out bExists);
|
||||
if (bExists)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (SqlCeEngine engine = new SqlCeEngine(credential.ConnectionString))
|
||||
{
|
||||
// Specify null destination connection string for in-place repair
|
||||
engine.Repair(null, RepairOption.RecoverAllPossibleRows);
|
||||
}
|
||||
}
|
||||
catch (SqlCeException e)
|
||||
{
|
||||
dbError = DBMS.CreateErrorDBRetVal(DBSystem.SQL_CE, e);
|
||||
}
|
||||
}
|
||||
//// Now try to repair the database if it exists
|
||||
//bool bExists = false;
|
||||
//dbError = DatabaseExists(credential, out bExists);
|
||||
//if (bExists)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// using (SqlCeEngine engine = new SqlCeEngine(credential.ConnectionString))
|
||||
// {
|
||||
// // Specify null destination connection string for in-place repair
|
||||
// engine.Repair(null, RepairOption.RecoverAllPossibleRows);
|
||||
// }
|
||||
// }
|
||||
// catch (SqlCeException e)
|
||||
// {
|
||||
// dbError = DBMS.CreateErrorDBRetVal(DBSystem.SQL_CE, e);
|
||||
// }
|
||||
//}
|
||||
return dbError;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
#if SQLCOMPACT
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -39,3 +40,4 @@ namespace Sdaleo.Systems.SQLCE
|
||||
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
#if SQLCOMPACT
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -13,3 +14,4 @@ namespace Sdaleo.Systems.SQLCE
|
||||
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
#if SQLCOMPACT
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -37,3 +38,4 @@ namespace Sdaleo.Systems.SQLCE
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
#if SQLCOMPACT
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -93,3 +94,4 @@ namespace Sdaleo.Systems.SQLCE
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user