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

  • 相关阅读:
    docker tcp配置
    PostgreSQL 数据库备份
    docker 几种磁盘卷挂载方式的区别
    MAT
    OkHttp
    HashMap 在 Java1.7 与 1.8 中的区别
    【zabbix】zabbix 高可用架构的实现
    利用zabbix监控Vmware运行
    logback在SpringBoot下出现no applicable action for [appender], current ElementPath is
    NGUI:HUD Text(头顶伤害漂浮文字)
  • 原文地址:https://www.cnblogs.com/ajun/p/2814511.html
Copyright © 2011-2022 走看看