private void guna2Button1_Click(object sender, EventArgs e) { try { String name = txtName.Text; double price = Convert.ToDouble(txtPrice.Text); DBconnection ob = new DBconnection(); ob.updatePriceList(name, price); clear(); displayPriceList(); } catch (Exception ex) { MessageBox.Show("Error Update! \n" + ex, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }