日期:2014-05-20 浏览次数:20906 次
//最小的id
var resMin = dc.VM_SYS_Menu.Select(c => c.MenuID ).Min();
//得到大的id
var resMax = dc.VM_SYS_Menu.Select(c => c.MenuID ).Max();
//最小的id
int MinID = Convert.ToInt32(resMin);
//最大的id
int MaxID = Convert.ToInt32(resMax);
var resAll = (from a in dc.VM_SYS_Menu select new { a.MenuID });
想得到所有的MenuID,跟maxid,minid比较,
如果循环获取到所有的MenuID