protected void btn_update_Click( object sender, EventArgs e ) { //defaultstatus(); string pid = this.txtbox_patientid.Text; string name = this.txtbox_name.Text; string gender = this.txtbox_gender.Text; string tempdate = this.txtbox_birthday.Text; string tempage = this.txtbox_age.Text; string medical = this.txtbox_medical.Text; if ( pid.Length > 0 && name.Length > 0 && gender.Length > 0 && tempdate.Length > 0 && tempage.Length > 0 && medical.Length > 0 ) { BusinessTier.Admin admin = new BusinessTier.Admin(); Data.DataBase.patientsDataTable table = new Data.DataBase.patientsDataTable(); table = admin.SearchPatientByID(pid); if ( table.Rows.Count > 0 ) { try { DateTime date =DateTime.Parse(tempdate); int age = int.Parse(tempage); admin.UpdatePatientByID(name, gender, date.Date, age, medical, pid); } catch ( Exception ex ) { this.lbl_searchwarning.Text = ex.Message; } } else { this.lbl_idwarning.Text = "This ID is not exsit"; this.lbl_idwarning.BackColor = System.Drawing.Color.Red; } } else { errorWarning(); } }