当我尝试将 int 与 int 进行比较时(当比较字符串时它可以工作),我会得到这个错误。
IEnumerable<Commune> myCommunes = from d in db.Communes
where d.CodePostal == Convert.ToInt32(CodePostal.Text)
select d;
foreach (Commune c in myCommunes)
{
CommunesList.Add(c);
}
有什么想法吗?(涉及IT技术的问题)
CodePostal.Text
转换为整数。 - Security Hound