zoukankan      html  css  js  c++  java
  • SQLite数据查询

    using Mono.Data.Sqlite

    using System.Data

                   /// <summary> 
                     /// 执行一个查询语句,返回一个包含查询结果的DataTable 
                     /// </summary> 
                     /// <param name="sql">要执行的查询语句</param> 
                     /// <param name="parameters">执行SQL查询语句所需要的参数,参数必须以它们在SQL语句中的顺序为准</param> 
                     /// <returns></returns> 
                     public DataTable ExecuteDataTable(string sql, SQLiteParameter[] parameters) 
                     { 
                             using (SqliteConnection connection = new SqliteConnection(connectionString)) 
                             { 
                                     using (SqliteCommand command = new SqliteCommand(sql, connection)) 
                                     { 
                                             if (parameters != null) 
                                             { 
                                                     command.Parameters.AddRange(parameters); 
                                             } 
                                             SqliteDataAdapter adapter = new SqliteDataAdapter(command); 
                                             DataTable data = new DataTable(); 
                                             adapter.Fill(data); 
                                             return data; 
                                     } 
                             } 
            
                     }

  • 相关阅读:
    运算符优先级口诀
    [转] 从最大似然到EM算法浅解
    推荐系统实践整体化总结
    Python-函数
    Python-dict/set
    Python-条件、循环、
    Python-list and tuple
    优先级顺序表
    8.1python类型注解
    9.redis-CacheCloud
  • 原文地址:https://www.cnblogs.com/roger634/p/5865262.html
Copyright © 2011-2022 走看看