zoukankan      html  css  js  c++  java
  • Linq to sql 分页

       在读取的数据集进行跳跃查询,关键方法Skip().Take(); 

       Skip跳过序列中指定的元素

       Take从序列的开头返回指定数量的连续元素

        var select = from n in entities.lib_reportinfo
                         join e in entities.lib_enterprise on n.Ep_Guid equals e.Guid into temp_ne
                         from tt in temp_ne.DefaultIfEmpty()
                         select new
                         {
                             guid = n.Guid,
                             epName = tt.Ep_Name,
                             epTrade = tt.Ep_Trade,
                             riName = n.Ri_ReportName,
                             riTime = n.Ri_PubTime,
                             riNd = n.Ri_ReportYear,
                             riCreateTime = n.CreateTime,
                             riPath = n.Ri_ReportPath
                         };
            pagecount.Text = select.ToList().Count.ToString();
            var query = select.OrderByDescending(r => r.riCreateTime).Skip(pagesize * (pageindex - 1)).Take(pagesize);       
            ListView1.DataSource = query;
            ListView1.DataBind();

  • 相关阅读:
    java并发之CountDownLatch
    在字符串中找出连续最长的数字串
    201301 JAVA题目0-1级
    linux vi 快捷键
    并行流水线、搜索、排序
    JDK中的Future模式
    Disruptor
    Unsafe类 AtomicReference AtomicStampedReference AtomicIntegerArray AtomicIntegerFieldUpdater vector SynchronousQueue
    java 虚拟机 分区 及 GC
    java 虚拟机对锁对优化
  • 原文地址:https://www.cnblogs.com/ajun/p/2814511.html
Copyright © 2011-2022 走看看