zoukankan      html  css  js  c++  java
  • return columns.All(new Func<string, bool>(list.Contains));

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

  • 相关阅读:
    Bootstrap 可视化布局--拖拽后弹窗进行编辑
    Missing letters
    DNA Pairing
    Pig Latin
    Search and Replace
    Where art thou
    Roman Numeral Converter
    Diff Two Arrays
    Sum All Numbers in a Range
    Caesars Cipher
  • 原文地址:https://www.cnblogs.com/shiningrise/p/5564863.html
Copyright © 2011-2022 走看看