private void btnSaveNote_Click(object sender, EventArgs e) { try { int problemVal; if (chkIsProblem.Checked == true) { problemVal = -1; } else { problemVal = 0; } SqlStatements sqlUpdateNote = new SqlStatements(); sqlUpdateNote.SaveNote(int.Parse(txtSearch.Text), this.txtPaintingNote.Text, problemVal); MessageBox.Show("Note saved successfully!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception) { MessageBox.Show("Note error, did not save", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }