protected void BtnDeptUpdate_Click(object sender, EventArgs e) { try { emp.EmpId = Convert.ToInt32(DdlEmpName.SelectedValue); emp.Dept = Convert.ToInt32(DdlDept.SelectedValue); int Result = emp.ModifyDepartmentDetails(); if (Result == 1) { lblMsg.Text = "Record Updated Successfully"; } else { lblMsg.Text = "Record Not Updated "; } } catch (Exception ex) { lblMsg.Text = ex.Message; } }