using (AdventureWorks2012Entities db = new AdventureWorks2012Entities()) { int num = (from stu in db.Customer orderby stu.CustomerID select stu).ToList().Count; for (int i = 0; i < num;i=i+100) { var students = (from stu in db.Customer orderby stu.Cu…
最后调用的CSharp代码可以是: int totalcount = dboperator.Customers.Count(); //总记录数 int pagesize = 100;//每页显示数 //错误写法 int pages = (int)Math.Round((double)totalcount / pagesize);//总页数 //正确写法:向上取整 int pages= (int)Math.Ceiling((double)totalcount / pagesize); for (i…