SQLite的查询
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的查询的更多相关文章
- IOS开发数据库篇—SQLite模糊查询
		
IOS开发数据库篇—SQLite模糊查询 一.示例 说明:本文简单示例了SQLite的模糊查询 1.新建一个继承自NSObject的模型 该类中的代码: // // YYPerson.h // 03- ...
 - SQLite -插入查询
		
SQLite -插入查询 SQLite插入语句是用来添加新行数据到数据库中的一个表. 语法: 有两种基本的插入语句的语法如下: INSERT INTO TABLE_NAME (column1, co ...
 - SQLite - SELECT查询
		
SQLite - SELECT查询 SQLite SELECT语句用于获取数据从一个SQLite数据库表返回数据结果表的形式.也称为result-sets这些结果表. 语法 SQLite SELECT ...
 - SQLite 参数化查询
		
SQLite参数化查询 首先给出两个参考博客: Sqlite DB sqlite3使用简介 贴出一段自己用的代码: #include <stdio.h> #include <stdl ...
 - sqlite常用查询
		
做的小工具用到了sqlite,在查询上较sqlserver还是稍有差异,将常用操作汇总一下,慢慢收集和整理. --查询版本SELECT sqlite_version() AS 'SQLite Vers ...
 - Android SQLite 通配符查询找不到参数问题
		
使用Android SQLite中SQLiteDatabase类的query方法查询时,如果where中包含通配符,则参数会无法设置,如类似下面的方法查询时 SQLiteDatabase db = d ...
 - SQLite区分大小写查询
		
http://www.cnblogs.com/zhuawang/archive/2013/01/15/2861566.html 大部分数据库在进行字符串比较的时候,对大小写是不敏感的.但是,在SQLi ...
 - SQLite -- 分页查询
		
原文:http://blog.csdn.net/lu1024188315/article/details/51734514 参考:http://www.runoob.com/sqlite/sqlite ...
 - sqlite数据库查询批量
		
采网页里的网址,网址每天都变化,而数据库里有几千条数据,通过 select count(*) 来查找数据库里有没有该网址,没有的话就采集入库,所 以如果网页当天更新1千条连接,那采集一次就要selec ...
 
随机推荐
- JSF 2 multiple select listbox example
			
In JSF, <h:selectManyListbox /> tag is used to render a multiple select listbox – HTML select ...
 - [iOS 多线程 & 网络 - 1.3] - NSOperation
			
A.NSOperation的基本使用 1.NSOperation的作用 配合使用NSOperation和NSOperationQueue也能实现多线程编程 NSOperation和NSOperatio ...
 - UIPanGestureRecognizer
			
http://blog.csdn.net/huifeidexin_1/article/details/8282035 UIGestureRecognizer是一个定义基本手势的抽象类,具体什么手势,在 ...
 - Oracle-11g-R2(11.2.0.3.x)RAC Oracle Grid & Database 零宕机方式回滚 PSU(自动模式)
			
回滚环境: 1.源库版本: Grid Infrastructure:11.2.0.3.15 Database:11.2.0.3.15 2.目标库版本: Grid Infrastructure:11.2 ...
 - MDF文件数据恢复
 - 使用C#开发纽曼USB来电小秘书客户端小结
			
在前面用C#开发完CRM的来电弹屏之后,有些客户有了新的要求,他们希望不但能够实现来电弹屏,更希望能够将呼入呼出的电话录音并上传到CRM服务器上,方便日后跟踪记录.于是便有了来电小秘书客户端的开发. ...
 - android数据库操作之直接读取db文件
			
在对数据库操作时,常用的有两种方法: 1.在代码中建库.建表: 2.直接将相关库.表建立好,将db文件拷贝至assets目录下: 现在来看看第二种方法: private String Ge ...
 - 网络IPC:套接字之套接字描述符
			
套接字是通信端点的抽象.与应用程序要使用文件描述符访问文件一样,访问套接字也需要套接字描述符.套接字描述符在UNIX系统是用文件描述符实现的.事实上,许多处理文件描述符的函数(如read和write) ...
 - Computer Science Theory for the Information Age-1: 高维空间中的球体
			
高维空间中的球体 注:此系列随笔是我在阅读图灵奖获得者John Hopcroft的最新书籍<Computer Science Theory for the Information Age> ...
 - PAT 1019
			
1019. General Palindromic Number (20) A number that will be the same when it is written forwards or ...