示例#1
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;
                }
            }
        }
示例#2
0
 public void Install()
 {
     if (IdentifyDatabaseConnectionString())
     {
         UpgradeInstaller.UpgradeDatabase(_connectionString, _newInstall);
     }
 }
示例#3
0
 public override void Install(System.Collections.IDictionary stateSaver)
 {
     base.Install(stateSaver);
     if (IdentifyDatabaseConnectionString())
     {
         UpgradeInstaller.UpgradeDatabase(_connectionString, _newInstall);
     }
 }