private void Delete() { if (ValidateChildren(ValidationConstraints.Enabled)) { try { int RowsAffected = 0; BusinessManager BM = new BusinessManager(); BOProduct BO = new BOProduct(); BO.ConfigID = txtConfigID.Text.Trim(); RowsAffected = BM.BALDeleteConfigData1(BO); if (RowsAffected > 0) { MessageBox.Show("Successfully deleted", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); New(); } else { MessageBox.Show("No Record Found", "Sorry", MessageBoxButtons.OK, MessageBoxIcon.Information); New(); } } catch (SqlException ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }