Check the Datatype For "PatientID" and "editPid" both must be same,
Check the Datatype For "ClinicID" and "Clinicid" both must be same,
and editPid , Clinicid must be not null
int Clinicid = ViewState["ClinicID"]==null?0: Convert.ToInt32(ViewState["ClinicID"]);
string editPid = string.IsNullOrEmpty(Request["editid"])?"":Request["editid"];