using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SQLite;

namespace _01复习1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            List<ManagerInfo> list = new List<ManagerInfo>();
            string connStr = @"data source=C:\Users\Administrator\Desktop\2015-05-13.NET就业班-三层项目+SVN\资料\ItcastCater.db;version=3;";
            using (SQLiteConnection conn = new SQLiteConnection(connStr))
            {
                using (SQLiteCommand cmd=new SQLiteCommand("select * from ManagerInfo",conn))
                {
                    conn.Open();
                    SQLiteDataReader reader = cmd.ExecuteReader();
                    if (reader.HasRows)
                    {
                        while (reader.Read())
                        {
                            list.Add(new ManagerInfo()
                            {
                                MId = int.Parse(reader["MId"].ToString()),
                                MName = reader["MName"].ToString(),
                                MPwd = reader["MPwd"].ToString(),
                                MType = int.Parse(reader["MType"].ToString()),
                            });
                        }
                    }
                    reader.Close();
                    this.dataGridView1.DataSource = list;
                }   
            }
        }
    }
}

SQLite的查询的更多相关文章

  1. IOS开发数据库篇—SQLite模糊查询

    IOS开发数据库篇—SQLite模糊查询 一.示例 说明:本文简单示例了SQLite的模糊查询 1.新建一个继承自NSObject的模型 该类中的代码: // // YYPerson.h // 03- ...

  2. SQLite -插入查询

     SQLite -插入查询 SQLite插入语句是用来添加新行数据到数据库中的一个表. 语法: 有两种基本的插入语句的语法如下: INSERT INTO TABLE_NAME (column1, co ...

  3. SQLite - SELECT查询

    SQLite - SELECT查询 SQLite SELECT语句用于获取数据从一个SQLite数据库表返回数据结果表的形式.也称为result-sets这些结果表. 语法 SQLite SELECT ...

  4. SQLite 参数化查询

    SQLite参数化查询 首先给出两个参考博客: Sqlite DB sqlite3使用简介 贴出一段自己用的代码: #include <stdio.h> #include <stdl ...

  5. sqlite常用查询

    做的小工具用到了sqlite,在查询上较sqlserver还是稍有差异,将常用操作汇总一下,慢慢收集和整理. --查询版本SELECT sqlite_version() AS 'SQLite Vers ...

  6. Android SQLite 通配符查询找不到参数问题

    使用Android SQLite中SQLiteDatabase类的query方法查询时,如果where中包含通配符,则参数会无法设置,如类似下面的方法查询时 SQLiteDatabase db = d ...

  7. SQLite区分大小写查询

    http://www.cnblogs.com/zhuawang/archive/2013/01/15/2861566.html 大部分数据库在进行字符串比较的时候,对大小写是不敏感的.但是,在SQLi ...

  8. SQLite -- 分页查询

    原文:http://blog.csdn.net/lu1024188315/article/details/51734514 参考:http://www.runoob.com/sqlite/sqlite ...

  9. sqlite数据库查询批量

    采网页里的网址,网址每天都变化,而数据库里有几千条数据,通过 select count(*) 来查找数据库里有没有该网址,没有的话就采集入库,所 以如果网页当天更新1千条连接,那采集一次就要selec ...

随机推荐

  1. zookeeper的配置项

    1 tickTime:CS通信心跳数 Zookeeper 服务器之间或客户端与服务器之间维持心跳的时间间隔,也就是每个 tickTime 时间就会发送一个心跳.tickTime以毫秒为单位. tick ...

  2. Could not allocate CursorWindow size due to error -12 错误解决方法

    04-29 11:13:54.284 13584-13584/com.uniubi.smartfrontdesk E/art: Throwing OutOfMemoryError "pthr ...

  3. BZOJ 2120: 数颜色 分块

    2120: 数颜色 Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://www.lydsy.com/JudgeOnline/problem.php? ...

  4. 在WebClient中使用post[发送数据]

    很多时候,我们需要使用C#中的WebClient 来收发数据,WebClient 类提供向 URI 标识的任何本地.Intranet 或 Internet 资源发送数据以及从这些资源接收数据的公共方法 ...

  5. xcode 左边导航栏中,类文件后面的标记“A”,&quot;M&quot;,&quot;?&quot;……等符号的含义???

    "M" = Locally modified    "U" = Updated in repository  "A" = Locally a ...

  6. Android常用代码集合

    这篇文章主要记录一些常用的一些代码段,方便以后查阅,不断更新中. 1:调用浏览器,载入某网址 1 2 3 Uri uri = Uri.parse("http://www.android-st ...

  7. [Angular 2] Understanding OpaqueToken

    When using provider string tokens, there’s a chance they collide with other third-party tokens. Angu ...

  8. [Javascript] Functor law

    Functor laws: 1. Identity: map(id) == id 2. Composition: compose(map(f), map(g)) == map(compose(f,g) ...

  9. ORACLE触发器具体解释

    ORACLE PL/SQL编程之八: 把触发器说透 本篇主要内容例如以下: 8.1 触发器类型 8.1.1 DML触发器 8.1.2 替代触发器 8.1.3 系统触发器 8.2 创建触发器 8.2.1 ...

  10. UserAgentStringLibrary

    It is at WebWorkContext.CurrentCustomer's part. //check whether request is made by a search engine / ...