示例#1
0
        private void Script()
        {
            if ((viewMode == ViewMode.Running))
            {
                MessageBox.Show("Already Running Something");
            }
            else
            {
                ViewModeSet(ViewMode.Running);
                feedbackL.Clear();

                if (workerThread != null)
                {
                    throw new InvalidOperationException("Oops worker thread still running");
                }

                //workerThread = new Thread(
                workerThreadArguments = new WorkerThreadArguments(true, this, txtServerInstance.Text, txtUserID.Text, txtPassword.Text, txtDataBaseName.Text, dropAllE.Checked, cmbCollationToMigrate.Text, languageE.SelectedItem as FullTextLanguage, singleUserE.Checked);
                workerThread          = new Thread(new ThreadStart(ScriptThreadProc));
                workerThread.Start();
            }
        }
示例#2
0
        private void executeB_Click(object sender, EventArgs e)
        {
            if ((viewMode == ViewMode.Running))
            {
                MessageBox.Show("Already Running Something");
            }
            else
            {
                if (MessageBox.Show("This program will now execute a script to alter the collation of your database.  This may take a long time and may result in data loss.  Please ensure that all your data is backed up.\n\nExclusive database access is required to complete the process so before running use the sp_who command to verify that there are no users connected to your database.", "Confirm", MessageBoxButtons.OKCancel, MessageBoxIcon.Stop, MessageBoxDefaultButton.Button2) == DialogResult.OK)
                {
                    ViewModeSet(ViewMode.Running);
                    feedbackL.Clear();

                    if (workerThread != null)
                    {
                        throw new InvalidOperationException("Oops worker thread still running");
                    }

                    workerThreadArguments = new WorkerThreadArguments(false, this, txtServerInstance.Text, txtUserID.Text, txtPassword.Text, txtDataBaseName.Text, dropAllE.Checked, cmbCollationToMigrate.Text, languageE.SelectedItem as FullTextLanguage, singleUserE.Checked);
                    workerThread          = new Thread(new ThreadStart(ScriptThreadProc));
                    workerThread.Start();
                }
            }
        }
        private void executeB_Click(object sender, EventArgs e)
        {

            if ((viewMode == ViewMode.Running))
            {
                MessageBox.Show("Already Running Something");
            }
            else
            {
                if (MessageBox.Show("This program will now execute a script to alter the collation of your database.  This may take a long time and may result in data loss.  Please ensure that all your data is backed up.\n\nExclusive database access is required to complete the process so before running use the sp_who command to verify that there are no users connected to your database.", "Confirm", MessageBoxButtons.OKCancel, MessageBoxIcon.Stop, MessageBoxDefaultButton.Button2) == DialogResult.OK)
                {
                    ViewModeSet(ViewMode.Running);
                    feedbackL.Clear();

                    if (workerThread != null)
                        throw new InvalidOperationException("Oops worker thread still running");

					workerThreadArguments =  new WorkerThreadArguments(false, this, serverE.Text, userIdE.Text, passwordE.Text, databaseE.Text, dropAllE.Checked, collationE.Text, languageE.SelectedItem as FullTextLanguage, singleUserE.Checked);
                    workerThread = new Thread(new ThreadStart(ScriptThreadProc));
                    workerThread.Start();
                }


            }

        }
        private void Script()
        {
            if ((viewMode == ViewMode.Running))
            {
                MessageBox.Show("Already Running Something");
            }
            else
            {
                ViewModeSet(ViewMode.Running);
                feedbackL.Clear();

                if (workerThread!=null)
                    throw new InvalidOperationException("Oops worker thread still running");

				//workerThread = new Thread(
				workerThreadArguments  =new WorkerThreadArguments(true,this, serverE.Text, userIdE.Text, passwordE.Text, databaseE.Text, dropAllE.Checked, collationE.Text, languageE.SelectedItem as FullTextLanguage, singleUserE.Checked);
                workerThread = new Thread(new ThreadStart(ScriptThreadProc));
                workerThread.Start();


            }
        }