//Method to edit data from the database private void EdittoolStripButton_Click(object sender, EventArgs e) { if (Idtextediter.Text == "") { MessageBox.Show("Please Insert Branch ID"); } else { var updatebranch = new Branch() { ID = Convert.ToInt32(Idtextediter.Text), BranchName = Branchnametextbox.Text, SpecialPlaceName = Specialplacetextbox.Text, Description = Descriptiontextbox.Text, Remarks = Remarkstextbox.Text }; var upbranchBiz = new BranchBiz(); if (MessageBox.Show("are you sure you want to Edit this file ?", "Confirm Updating", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) { var result = upbranchBiz.Update(updatebranch); if (result.Status) { MessageBox.Show("Successfuly Updated"); clearbr(); } else { MessageBox.Show("Update faild." + result.Message); } } } }