internal static bool VerifyColumns(SqlConnection conn, string table, params string[] columns)
        {
            List<string> list = new List<string>();
            using (SqlCommand sqlCommand = new SqlCommand("SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS where TABLE_NAME=@Table", conn))
            {
                sqlCommand.Parameters.Add(new SqlParameter("Table", table));
                using (SqlDataReader sqlDataReader = sqlCommand.ExecuteReader())
                {
                    while (sqlDataReader.Read())
                    {
                        list.Add(sqlDataReader.GetString(0));
                    }
                }
            }
            return columns.All(new Func<string, bool>(list.Contains));
        }

return columns.All(new Func<string, bool>(list.Contains));的更多相关文章

  1. Predicate<T>与Func<T, bool>泛型委托

    引用别人的: static void Main(string[] args) { List<string> l = new List<string>(); l.Add(&quo ...

  2. C#中Predicate<T>与Func<T, bool>泛型委托的用法实例

    本文以实例形式分析了C#中Predicate<T>与Func<T, bool>泛型委托的用法,分享给大家供大家参考之用.具体如下: 先来看看下面的例子: 1 2 3 4 5 6 ...

  3. 解释下Func<T, bool> exp

    比如 interface IRepository<T> where T:class { IEnumerable<T> FindAll(Func<T, bool> e ...

  4. C# 泛型 Func<object, string, bool> filter

    Func<object, string, bool>是泛型,你可以先把他看成一个普通类型,比如stringpublic class Func{ } // 自定义个普通类. Func fil ...

  5. 转自pnljs 委托(Func<int,bool>)

    随笔- 147 文章- 0 评论- 16 Func的介绍   经常看到  Func<int, bool>...这样的写法,看到这样的就没有心思看下去了.我们学技术还是需要静下心来. 对Fu ...

  6. expression<Func<object,Bool>> 及 Func<oject,bool>用法

    using System;using System.Collections.Generic;using System.Linq;using System.Linq.Expressions;using ...

  7. 拉姆达表达式 追加 条件判断 Expression<Func<T, bool>>

    public static class PredicateBuilder { /// <summary> /// 机关函数应用True时:单个AND有效,多个AND有效:单个OR无效,多个 ...

  8. lambda表达式Expression<Func<Person, bool>> 、Func<Person, bool>区别

    前言: 自己通过lambda表达式的封装,将对应的表达式转成字符串的过程中,对lambda表达式有了新的认识 原因: 很多开发者对lambda表达式Expression<Func<Pers ...

  9. .NetCore 扩展封装 Expression<Func<T, bool>> 查询条件遇到的问题

    前面的文章封装了查询条件 自己去组装条件,但是对 And  Or  这种组合支持很差,但是也不是不能支持,只是要写更多的代码看起来很臃肿 根据 Where(Expression<Func< ...

随机推荐

  1. HttpHelper类

    using System;using System.Collections.Generic;using System.Text;using System.Net;using System.IO;usi ...

  2. innerHTML和appendChild的性能

    目测innerHTML比appendChild好了3到4倍, 但是界面渲染还是很慢啊:  chrome结果 /** *chrome浏览器; * innerHTML appendChild * 1千条的 ...

  3. 树分治 点分治poj 2114

    存在2点间距离==k 输出AYE 否则输出NAY #include<stdio.h> #include<string.h> #include<algorithm> ...

  4. 强联通 HDU 2767 3836

    n个点m条边 最少需要几条边变成强连通图 设有a个结点的入读为0, b个结点的出度为0, 则 max{a, b}就是答案. 注意特殊情况: 当原图已经强连通时, 答案是0而不是1. 加一条边少一个入度 ...

  5. cygwin-使用介绍

    cygwin使用: 使用上的方便性很是不错,启动Cygwin以后,会在Windows下得到一个Bash Shell,由于Cygwin是以Windows下的服务运行的,所以很多情况下和在Linux下有很 ...

  6. sql 定义自增id插入数据

    -- 定义一个自增变量 ; -- 执行自增语句 ,sponsorbroker,,, from stock_listing_detailed_info group by sponsorbroker;

  7. selenium+eclispse里代码备注

    1.火狐.谷歌和IE浏览器引擎都要重新下载selenium官网引擎,并设置路径才可以支持selenium3 而狐火用自己的引擎不用设置路径既可以支持selenium2也支持selenium3,谷歌和I ...

  8. 【Codeforces 707A】Brain's Photos 水题

    黑白灰都是#Black&White #include <cstdio> int n,m; int main() { scanf("%d%d",&n,&a ...

  9. Hive 的 map join

    学习自 http://blog.csdn.net/xqy1522/article/details/6699740 1. Map Join 的使用场景: 关联操作中有一张表非常小 不等值的链接操作 2. ...

  10. js-JavaScript高级程序设计学习笔记1

    第一章 1.一个完整的JavaScript实现应该由三个不同的部分组成:核心(ECMAScript).文档对象模型(DOM,提供访问和操作网页内容的方法和接口),浏览器对象模型(BOM,提供与浏览器交 ...