0
嗨我太新的實體框架和即時通訊使用它在Windows窗體應用程序。LINQ to Entities無法識別方法'System.Windows.Forms.DataGridViewCell get_Item(Int32)'方法
using (GezentiEntities GE = new GezentiEntities())
{
var cities = from c in GE.Cities
where c.CountryId == ((Guid)(dgCountry.SelectedRows[0].Cells[0].Value))
select new { c.Id, Şehir = c.Name };
dgCity.DataSource = cities.ToList();
}
on dgCity.DataSource = cities.ToList();當它使用條件和((Guid)(dgCountry.SelectedRows [0] .Cells [0] .Value))代碼工作正常它給我的ID時,它給了我錯誤。
太感謝你了。 –