public void Install() { if (IdentifyDatabaseConnectionString()) { UpgradeInstaller.UpgradeDatabase(_connectionString, _newInstall); } }
public void Install(string masterConnectionString, string newDatabaseName, string newDatabaseConnectionString) { SqlServers.CreateDatabase(masterConnectionString, newDatabaseName); DateTime startTime = DateTime.Now; while (DateTime.Now.Subtract(startTime).TotalSeconds < 9) { Application.DoEvents(); } try { UpgradeInstaller.UpgradeDatabase(newDatabaseConnectionString, true); } catch (Exception ex) { System.Threading.Thread.Sleep(8000); try { UpgradeInstaller.UpgradeDatabase(newDatabaseConnectionString, true); } catch { throw; } } }
public override void Install(System.Collections.IDictionary stateSaver) { base.Install(stateSaver); if (IdentifyDatabaseConnectionString()) { UpgradeInstaller.UpgradeDatabase(_connectionString, _newInstall); } }
public static void UpgradeDatabase(string connectionString, bool newInstall) { try { UpgradeInstaller upgradeInstaller = new UpgradeInstaller(connectionString, newInstall); upgradeInstaller.Initialize(); upgradeInstaller.RunUpgrade(); } catch (Exception ex) { throw; } }