C# 获取表中最大值

         int startmaxid = 0;
            if (db.LPicture.Any())
            {
               // LPicture Newmode = db.LPicture.Where(n => ).FirstOrDefault();

                startmaxid = db.LPicture.Max(q => q.LPictureid);
                int endmaxid = db.LPicture.Select(s => s.LPictureid).Max();
            }

 

posted @ 2018-11-19 09:37  enych  阅读(2113)  评论(0编辑  收藏  举报