コード例 #1
0
        private void buttonDeleteList_Click(object sender, EventArgs e)
        {
            try
            {
                var result = MessageBox.Show("Are you sure ?", "Confirmation", MessageBoxButtons.OKCancel);

                if (result == DialogResult.OK)
                {
                    connectionDB.deleteList(comboBoxList.Text);       // Use method to delete the list from database
                    MessageBox.Show("List deleted successfully");
                }
                ViewList_Load(null, null);
            }

            catch
            {
                MessageBox.Show("ERROR : can't update the database", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }