1. 程式人生 > >C# 獲取表中最大值

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();
            }