private void btnSearch_Click(object sender, EventArgs e) { if (txtSearch.Text == string.Empty) { MessageBox.Show("Please input ID"); return; } int ID = 0; try { ID = int.Parse(txtSearch.Text); } catch (Exception ex) { MessageBox.Show("Input invalid"); } Album pro = bm.FindProduct(ID); if (pro != null) { frmProductDetails ProductDetail = new frmProductDetails(false, pro); DialogResult r = ProductDetail.ShowDialog(); if (r == DialogResult.OK) { DataRow row = dtProduct.Rows.Find(pro.AlbumID); row["AlbumName"] = pro.AlbumName; row["ReleaseYear"] = pro.ReleaseYear; row["Quantity"] = pro.Quantity; } } else { MessageBox.Show("Product not exist!"); } getAllBooks(); }