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 ...
随机推荐
- JAVA 反射应用:properties2Object
MixAll.java import java.lang.reflect.Method; import java.util.Properties; public class MixAll { /** ...
- POJ 1573 (13.10.11)
Description A robot has been programmed to follow the instructions in its path. Instructions for the ...
- mybatis generator配置文件
<!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration ...
- HtmlAgilityPack相关网页
//多线程 http://www.cnblogs.com/jiangming/archive/2012/09/11/MultiThreadCallWebbrowser.html //替换Webbrow ...
- Codeforces Round #327 (Div. 2) D. Chip 'n Dale Rescue Rangers 二分 物理
D. Chip 'n Dale Rescue Rangers Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/co ...
- URAL 2048 History 蔡勒公式
HistoryTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.acti ...
- delphi 获取网页源代码
//获取网页源代码 var s: string; begin s := WebBrowser1.OleObject.document.body.innerHTML; //body内的所有代码 ...
- 使用IIS 7.0 Smooth Streaming 优化视频服务
http://www.cnblogs.com/dudu/archive/2013/06/08/iis_webserver_settings.html (支持高并发的IIS Web服务器常用设置) ht ...
- hibernate 实体关系映射笔记
@经常使用属性说明: @Entity:实体类 @Table:指定相应数据表 @Id:主键,使用能够为null值的类型,假设实体类没有保存到数据库是一个暂时状态 @Col ...
- python selenium自动化(三)Chrome Webdriver的兼容
当一个自动化测试被实现在一个浏览器之后,我们会希望我们的测试能够覆盖到尽量多的别的浏览器.通过跨平台的测试来保证我们的程序在多个浏览器下都能正常工作. 在安装了selenium之后,firefox w ...