using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Sdaleo.Systems.SQLCE
{
///
/// General SQL CE Functions
///
public class SQLCEGeneral
{
///
/// Quick Check function to see if the passed in credential allows us to connect to the database,
/// It also verifies that there are any Tables in the Database
///
/// SQL CE Credentials
/// Returns true if successfull in connecting to the database
/// DBError Object with ErrorOccured, if error Occured
public static DBError SQLCECheckConnection(IConnectDb credential, out bool CanConnect)
{
CanConnect = false;
DBError dbError = ValidationConsts.IsCredentialValid(credential, DBSystem.SQL_CE);
if (dbError.ErrorOccured)
return dbError;
// First Verify that the Database Exists
bool bExists = false;
dbError = SQLCEDatabase.DatabaseExists(credential, out bExists);
if (!bExists)
return dbError;
////
// TODO: Make sure that we can read any tables from the db
////
return null;
}
}
}