//普通查询

var query = (from t in ServiceList
                                 where t.CreateUserID == ActionID.ToInt(0) 87 
                                 select t);


     var query = (from t in table.AsEnumerable()
                             where t.Field<string>("姓名") != null && !string.IsNullOrEmpty(t.Field<string>("姓名").ToString())
                             group t by t.Field<string>("姓名") into g
                             select g);


//对比一个集合
    var doublesArray = superior.Split(',');
                    if (doublesArray.Count() > 0)
                    {
                        var foos = from tq in ServiceList
                                   where doublesArray.Contains(tq.CreateUserID.ToString())
                                   orderby tq.CreateDate descending
                                   select tq;
                        return foos.Count().ToString();
                    }

//分组

     var query = (from t in table.AsEnumerable()
                             where t.Field<string>("姓名") != null && !string.IsNullOrEmpty(t.Field<string>("姓名").ToString())
                             group t by t.Field<string>("姓名") into g
                             select g);

//取值

  string name = row.FirstOrDefault().Field<string>("姓名");

          var query1 = (from k in table.AsEnumerable()
                                      where k.Field<string>("姓名") == row.FirstOrDefault().Field<string>("姓名")
                            .ToString()

//绑定

                var query = (from t in ds.Tables[0].AsEnumerable()
                             // where t.Field<string>("QuestionNo") == QuestionNo
                             select t).Skip((this.Pager.CurrentPageIndex - 1) * this.Pager.PageSize).Take(this.Pager.PageSize);
                DataTable boundTable = query.CopyToDataTable<DataRow>();
                RepeaterCommentList.DataSource = boundTable;
                RepeaterCommentList.DataBind();


    //jbox
        function ImgPhoto(Id) {
            var option = {
                id: 'ImgPhoto', top: '15px', buttons: { '确认选择': true,'取消': false }, showClose: true, persistent: true, buttonsFocus: 0, bottomText: '确认操作:', submit: function (v, h, f) {
                    alert(v);
                    if (v == 0) {
                        return true; // close the window
                    }
                }
            };
            $.jBox.open('iframe:ImgeDialog.aspx?Id=' + Id, "图片库", 695, 430, option);

        }

//多参数in查询
 int[] JobStatus_Arry = { (int)Enums.JobStatus.待上传, (int)Enums.JobStatus.上传中 };
 MdDatacubeofjobinfotask _MdDatacubeofjobinfotaskModel = _MdDatacubeofjobinfotaskBL.GetList("").Where<MdDatacubeofjobinfotask>(k => JobStatus_Arry.Contains(k.Status.Value)).OrderBy(x => x.DataChange_CreateTime).FirstOrDefault();

linq使用日记的更多相关文章

  1. .Net Core 爬坑日记

    安装[DotNetCore.1.0.1-VS2015Tools.Preview2.0.3.exe]失败 查看log发现,发现猫腻,然后copy下链接,用迅雷手动下载[AspNetCoreLocalFe ...

  2. 把旧系统迁移到.Net Core 2.0 日记(1) - Startup.cs 解析

    因为自己到开发电脑转到Mac Air,之前的Webform/MVC应用在Mac 跑不起来,而且.Net Core 2.0 已经比较稳定了. 1. 为什么会有跨平台的.Net Core  近年来,我们已 ...

  3. LogHelp 日记分天记录,只记30天日记

    using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Tex ...

  4. Linq表达式、Lambda表达式你更喜欢哪个?

    什么是Linq表达式?什么是Lambda表达式? 如图: 由此可见Linq表达式和Lambda表达式并没有什么可比性. 那与Lambda表达式相关的整条语句称作什么呢?在微软并没有给出官方的命名,在& ...

  5. Linq之旅:Linq入门详解(Linq to Objects)

    示例代码下载:Linq之旅:Linq入门详解(Linq to Objects) 本博文详细介绍 .NET 3.5 中引入的重要功能:Language Integrated Query(LINQ,语言集 ...

  6. [C#] 走进 LINQ 的世界

    走进 LINQ 的世界 序 在此之前曾发表过三篇关于 LINQ 的随笔: 进阶:<LINQ 标准查询操作概述>(强烈推荐) 技巧:<Linq To Objects - 如何操作字符串 ...

  7. [C#] 进阶 - LINQ 标准查询操作概述

    LINQ 标准查询操作概述 序 “标准查询运算符”是组成语言集成查询 (LINQ) 模式的方法.大多数这些方法都在序列上运行,其中的序列是一个对象,其类型实现了IEnumerable<T> ...

  8. 微信小程序开发日记——高仿知乎日报(下)

    本人对知乎日报是情有独钟,看我的博客和github就知道了,写了几个不同技术类型的知乎日报APP 要做微信小程序首先要对html,css,js有一定的基础,还有对微信小程序的API也要非常熟悉 我将该 ...

  9. 微信小程序开发日记——高仿知乎日报(中)

    本人对知乎日报是情有独钟,看我的博客和github就知道了,写了几个不同技术类型的知乎日报APP要做微信小程序首先要对html,css,js有一定的基础,还有对微信小程序的API也要非常熟悉 我将该教 ...

随机推荐

  1. 安装nginx-1.5.2

    新建用户及用户组groupadd webuseruseradd -g webuser webuser 下载nginx-1.5.2 下载地址:http://pan.baidu.com/s/1gd1khc ...

  2. CentOS7安装MySQL的方法之通用二进制格式

      CentOS7安装MySQL的方法之通用二进制格式          

  3. 洛谷 [P2756] 飞行员配对方案问题 网络流实现

    网络流实现二分图匹配 对于x集合的每一个点连一条从源点出发的容量为一的边,对于y集合的每一个点连一条到汇点的容量为一的边,跑最大流 #include <iostream> #include ...

  4. 引用MinGW生成的.dll.a后出现的问题

    以前很少调用MinGW的运行时库,现在用到一个项目,用到了glib和gettext等. 遇到了一个问题,折腾了一个下午. gettext的运行时库之一是intl,MinGW只提供了.dll.a,于是参 ...

  5. FlappyBird Pygame

    视频链接 GitHub链接:https://github.com/yanpeng1314/FlappyBird from InitObject import * def startGame(): mo ...

  6. error: Autoconf version 2.67 or higher is required

    error: Autoconf version 2.67 or higher is required 今天linux下遇到这种错误,顺便记录下来. #rpm -qf /usr/bin/autoconf ...

  7. [Python Study Notes]CS架构远程访问获取信息--SERVER端v2.0

    更新内容: 1.增加内存信息获取 2.增加电池信息获取 3.增加磁盘信息获取 4.重新布局窗体 5.增加窗体名称 6.增加连接成功之前,不可按压 ''''''''''''''''''''''''''' ...

  8. CentOS 7 安装Maven

    Maven的下载地址是:http://maven.apache.org/download.cgi 安装Maven非常简单,只需要将下载的压缩文件解压就可以了. cd /data wget http:/ ...

  9. How to install tcpping on Linux.md

    To install tcptraceroute on Debian/Ubuntu: $ sudo apt-get install tcptraceroute To install tcptracer ...

  10. CENTOS6.6下mysql5.6的源码安装

    本文来自我的github pages博客http://galengao.github.io/ 即www.gaohuirong.cn 1.下载:当前mysql版本到了5.6.28 http://dev. ...