private void button1_Click(object sender, EventArgs e) { age_find(); try { persond.EMPID = txtempid.Text; persond.NIC = txtfind.Text; persond.DEPID = cmb1.SelectedValue.ToString(); persond.FIRSTNAME = txtfname.Text; persond.LASTNAME = txtlname.Text; persond.FULLNAME = txtfullname.Text; persond.SEX = cbgender.Text; persond.AGE = int.Parse(age.ToString()); persond.DOB = DateTime.Parse(dateTimePicker1.Text); persond.ADDRESS = txtaddress.Text; persond.CITY = txtcity.Text; persond.COUNTRY = txtcountry.Text; persond.BUSNUMBER = txtbisnum.Text; persond.CONFIRM = cmbconf.Text; persond.MSTATUS = cmbsta.Text; persond.BASIC = txtnote.Text; persond.DESIGNATION = txtdesig.Text; pbal.Update_P(persond); MessageBox.Show("Record Updated Successfull", "Employee", MessageBoxButtons.OK, MessageBoxIcon.Information); GridView1.DataSource = pbal.Bind_Getdata(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }