protected override DbConnection CreateDbConnection() { string connectionString = string.Format("Data Source = {0};", Database); if (!DbPassword.Equals("")) { connectionString = string.Format("Data Source = {0}; Password = {1};", Database, DbPassword); } if (!File.Exists(Database)) { SqlCeEngine engine = new SqlCeEngine(connectionString); engine.CreateDatabase(); } SqlCeConnection conn = new SqlCeConnection(connectionString); try { conn.Open(); } catch (SqlCeException ex) { Log(ex.Message); return(null); } catch (Exception ex) { Log(ex.Message); return(null); } return(conn); }
public void RemovePassword() { DbPassword test = new DbPassword("Test1", "Test1"); DbManager.Instance.InsertPassword(test); DbManager.Instance.DeletePass(test); }