Linq:无效的Cast异常

时间:2015-03-13 09:52:50

标签: asp.net linq c#-4.0

int Clinicid = Convert.ToInt32(ViewState["ClinicID"].ToString());
        string editPid = Request["editid"].ToString();

        dynamic edt = (from ed in dc.dentist_addnewpatientmodifies
                       where ed.PatientID == editPid && ed.ClinicID == Clinicid
                       select ed).FirstOrDefault();

异常详细信息:

  

System.InvalidCastException:指定的强制转换无效。

enter image description here enter image description here

0 个答案:

没有答案