//下一条
int pollid = poll.Where(f => f.PollID < CurrentId).OrderByDescending(o => o.PollID).FirstOrDefault().PollID; //上一条
int pollid = poll.Where(f => f.PollID > CurrentId).OrderByDescending(o => o.PollID).FirstOrDefault().PollID;

Linq-查询上一条下一条的更多相关文章

  1. php 新闻上一条下一条

    public function prevnext($table,$id,$where=[]){ $ids=db($table)->field('id,title')->order('sor ...

  2. MYSQL实现上一条下一条功能

    select id from(select *, (@i:=@i+1) as rownum from pre_bet_zhibo,(select @i:=0) as itwhere link_cone ...

  3. tp3.2博客详情页面查询上一篇下一篇

  4. 使用B或BL跳转时,下一条指令的地址的计算

    .text .global _start 3_start: b step1 step1: ldr pc, =step2 step2: b step2 反汇编代码: : eaffffff b 0x4 : ...

  5. MySQL查询当前数据上一条和下一条的记录

    如果ID是主键或者有索引,可以直接查找: 方法一: 查询上一条记录的SQL语句(如果有其他的查询条件记得加上other_conditions以免出现不必要的错误): ) [and other_cond ...

  6. 如何在MySQL中查询当前数据上一条和下一条的记录

    如果ID是主键或者有索引,可以直接查找: 方法一: 查询上一条记录的SQL语句(如果有其他的查询条件记得加上other_conditions以免出现不必要的错误): select * from tab ...

  7. MySQL查询上一条记录和下一条记录

    如果ID是主键或者有索引,可以直接查找: 方法一: 查询上一条记录的SQL语句(如果有其他的查询条件记得加上other_conditions以免出现不必要的错误): select * from tab ...

  8. sql查询上一条记录和下一条记录

    上一条记录的SQL语句: * from news where newsid<id order by newsid DESC 下一条记录的SQL语句: * from news where news ...

  9. Mysql 查询当前数据上一条和下一条的记录

    获取当前文件上一条与下一条记录的原理是上一条的sql语句,从news表里按从大到小的顺序选择一条比当前ID小的新闻,下一条的sql语句,从news表里按从小到大的顺序选择一条比当前ID大的新闻. 如果 ...

随机推荐

  1. UVALive 6910 Cutting Tree 并查集

    Cutting Tree 题目连接: https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8& ...

  2. 设置Azure WebSite黑白名单

    Azure WebSite服务默认是不提供黑白名单,也就是说任何Internet用户都可以访问Azure WebSite,那么我们如何来给我们的网站设置黑白名单? 这里有一种方式,可以通过配置网站的配 ...

  3. MongoDB简单使用 —— 基本操作

    本身MongoDB直接支持的是Bson文档,Bson文档在C#的官方驱动中对应的是BsonDocument类: var bsonDoc = new BsonDocument(){    [" ...

  4. VIM简单配置(windows)

    set number set history=1000000 set tabstop=4 set shiftwidth=4 set smarttab set nocp filetype plugin ...

  5. SWD Connect/Transfer Source Code

    Serial Wire Debug interface The Serial Wire Debug protocol operates with a synchronous serial interf ...

  6. MSDN WinUSB Example

    The WinUSB user-mode library uses device interface classes to communicate with the kernel-mode USB s ...

  7. Snmp学习总结(四)——WinServer2003安装和配置SNMP

    一.安装SNMP 今天讲解一下在WinServer2003安装和配置SNMP,具体操作步骤如下: 找到[控制面板]→[添加或删除程序]

  8. 源码编译Tkinter

    要让Python支持Tkinter, 需要首先安装tcl和tk两个软件包. 下载地址: http://www.tcl.tk/software/tcltk/download.html 或 tcl:htt ...

  9. VirtualBox - NAT虚拟机访问外网 + Host-Only物理主机虚拟机互访

    [root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-System_eth0 # 未手动设定HOST-ONLY静态IP时的默认值 #T ...

  10. Android Initializing a Build Environment

    from://https://source.android.com/source/initializing.html#next-download-the-source Initializing a B ...