Ejemplo n.º 1
0
 public void Install()
 {
     if (IdentifyDatabaseConnectionString())
     {
         UpgradeInstaller.UpgradeDatabase(_connectionString, _newInstall);
     }
 }
Ejemplo n.º 2
0
        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;
                }
            }
        }
Ejemplo n.º 3
0
 public override void Install(System.Collections.IDictionary stateSaver)
 {
     base.Install(stateSaver);
     if (IdentifyDatabaseConnectionString())
     {
         UpgradeInstaller.UpgradeDatabase(_connectionString, _newInstall);
     }
 }
Ejemplo n.º 4
0
 public static void UpgradeDatabase(string connectionString, bool newInstall)
 {
     try
     {
         UpgradeInstaller upgradeInstaller = new UpgradeInstaller(connectionString, newInstall);
         upgradeInstaller.Initialize();
         upgradeInstaller.RunUpgrade();
     }
     catch (Exception ex)
     {
         throw;
     }
 }