NestingQuery

DataClassesDataContext dc = new DataClassesDataContext();
var query = from type in dc.DictionaryType
select new
{
DictTypeName = type.DictTypeName,
ItemList = from item in dc.DictionaryItem
                where item.DictTypeID == type.DictTypeID
                select item
};
GridView1.DataSource = query;
GridView1.DataBind();

posted @ 2013-01-18 16:57  yellowshorts  阅读(102)  评论(0编辑  收藏  举报