private void btnOk_Click(object sender, EventArgs e) { if (txtInput.Text != "") { dbConnect con = new dbConnect(); string error = ""; int ret = con.ExecuteNonQuery(txtInput.Text, ref error); if (ret == -1) { MessageBox.Show(error, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { lblResult.Text = string.Format("Result: {0} records updated", ret); } } }