• Linq to sql GroupBy


    View Code
     protected IList<String> SelectTitleList()
            {
                using (SamjinDBDataContext db = new SamjinDBDataContext())
                {
                    IList<String> returnList = new List<String>();

                    var list = from v in db.View_Design_History
                               group v by v.Title into g
                               select new { 
                                   // g.key 是 v.Title 值 
                                            Title = g.Key
                                };
                    foreach (var item in list)
                    {
                        returnList.Add(item.Title);
                    }
                    return returnList;
                }
            }
  • 相关阅读:
    浅读《构建之法》
    def 和 lamdba的区别
    Numpy和Pandas的区别
    Django:每点击一次就增加行可输入的表格
    F函数和Q函数的作用
    super()的用法
    liunx操作系统
    celery(超详细)
    celery
    FastDFS环境搭建
  • 原文地址:https://www.cnblogs.com/YSO1983/p/2337029.html
Copyright © 2020-2023  润新知