private void btnClose_Click(object sender, EventArgs e) { if (MessageBox.Show("Do you really want to delete the image?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { try { BusinessManager BM = new BusinessManager(); int rowsAffected = BM.BALDeleteStoreImage(); MessageBox.Show("Store logo successfully deleted. You can add a new logo.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); pictureBox1.Image = null; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }