【发布时间】:2013-09-16 08:14:57
【问题描述】:
城市
CityID
Name
CountryID(FK)
国家
CountryID
CountryName
我想在 gridview 中显示所有城市显示 CountryName 而不是 CountryID With EntityDatasource
什么是最好的解决方案?
【问题讨论】:
标签: asp.net entity-framework-5
城市
CityID
Name
CountryID(FK)
国家
CountryID
CountryName
我想在 gridview 中显示所有城市显示 CountryName 而不是 CountryID With EntityDatasource
什么是最好的解决方案?
【问题讨论】:
标签: asp.net entity-framework-5
你能在内部加入国家表和城市表吗? 选择 t1.Name, t1.CountryId , t2.CountryId, t2.CountryName Cities t1 inner join countries t2 on t1.CountryID=t2.CountryID
你可以用 Cuntryname 代替 CountryID
【讨论】: