,當我嘗試比較INT爲int我得到這個錯誤(比較它的工作原理字符串時)LINQ到實體無法識別方法INT32 toint32
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);
}
任何想法?
在您的lINQ調用之前將CodePostal.Text轉換爲整數。 – 2012-07-05 15:32:54