日期:2014-05-20 浏览次数:20815 次
SELECT ExHotelCode FROM hotel_HotelLinkRelation hhlr GROUP BY ExHotelCode,hhlr.GDSCode
var query = from p in db.hotel_HotelLinkRelation group p by p new {ExHotelCode=p.ExHotelCode,GDSCode=p.GDSCode} into g select new { g.Key.ExHotelCode, g.Key.GDSCode };
------解决方案--------------------
给一个linq to sql 的学习资料
http://www.cnblogs.com/lovecherry/archive/2007/08/13/853754.html
------解决方案--------------------
改正一下
public static List<GDSHotelCode> GDSHotelCode() { HotelDataContext hotelData = new HotelDataContext(); List<GDSHotelCode> GDSHotelCodelList= (from p in hotelData.hotel_HotelLinkRelation group p by new { ExHotelCode = p.ExHotelCode, GDSCode = p.GDSCode } into g select new GDSHotelCode() { g.Key.ExHotelCode, g.Key.GDSCode }).ToList(); return GDSHotelCodelList; }
------解决方案--------------------