Example #1
0
        private void btnChange_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.AppStarting;
            Properties.Settings.Default.User         = txtUser.Text;
            Properties.Settings.Default.Password     = txtPassword.Text;
            Properties.Settings.Default.ServerName   = txtServer.Text;
            Properties.Settings.Default.DatabaseName = txtDatabase.Text;
            Properties.Settings.Default.Save();

            DBResource newConnection = new DBResource();

            if (newConnection.IsAvailable(newConnection.connectionString.ToString()))
            {
                MessageBox.Show("Database Settings successfully change.", "OCMS", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("Cannot find database server.", "OCMS", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            Cursor.Current = Cursors.Default;
        }