易截截图软件、单文件、免安装、纯绿色、仅160KB

SQLITE入门 逐步讲解SQLITE命令行(一)

首先做点铺垫说明:
sqlite程序通过查找分号(;)来决定一个SQL语句的结束,所以要执行SQL语句请确保在SQL语句后有分号(;).如果你省略分号,sqlite3将给你一个连续的命令提示符(...> )并等你给当前的SQL命令添加更多的文字。这个特点让你输入多行的多个SQL语句.但点号(.)命令不要分号(;).ctrl+c可以结束当前命令。
在dos窗口输入sqlite3 test.db,然后回车,结果如下:
F:\>sqlite3 test.db
SQLite version 3.6.16
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
此时我们并没有在F盘下看到 test.db,需要在输入分号(;)然后回车如下:
F:\>sqlite3 test.db
SQLite version 3.6.16
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> ;
sqlite>
我们现在就可以看到在F盘下有test.db文件了。
附:此命令如果没有test.db数据库则创建,如果有则打开,实例见下文。
建立表(websites),
命令
CREATE TABLE [websites] (
[WebID] INTEGER NOT NULL PRIMARY KEY,
[WebName] VARCHAR(20) NULL
);
注意;不可少";"号不可缺少,否则不执行。
插入数据:
insert into [websites] ([WebName])values('CTOChina.net');
insert into [websites] ([WebName])values('搜狐');
insert into [websites] ([WebName])values('雅虎');
查看数据:
sqlite> select * from websites;
1|CTOChina.net
2|搜狐
3|雅虎
sqlite>
转自:http://www.ctochina.net/topic/ShowArticle/346.html


相关文档:

SQLite Tutorial in PHP

 
SQLite Tutorial in PHP
SQLite is an SQL database manager used locally or on a website, and compatible
in particularly with PHP.
Summary
Installing SQLite and creating a database
.
Installing SQLite. Verifying the installation by creating a base.
Creating and using a SQLite tabl ......

sqlite关闭数据库,清除连接池

从网上找的例子,创建了一个数据库,追加了几条记录后,然后关闭数据库,然后准备向PDA下载数据库,发现文件竟然被占用了,已经关闭了数据库连接也无效,后来从网上看到需要清除连接池
using (SQLiteConnection cn = new SQLiteConnection("Data Source=" + strTempPath + "\\Smoke.db3;Pooling=true;FailIfMissing=false ......

SQLite数据库使用总结

1.在SQLite中插入当前时间,变量定义不用多说
char *sql = sqlite3_mprintf("insert into Log VALUES(datetime('now', 'localtime'), '%q', '%q')", cUser, cLogContent);
int ret = sqlite3_exec(Sqlite3, sql, NULL, NULL, &pErrMsg);
以月份为单位统计出符合当前月份的记录, Time为数据库中字段名:
char *sql = s ......

Qt:SQLite 3入门教程


OS X自从10.4后把SQLite这套相当出名的数据库软件,放进了作业系统工具集里。OS X包装的是第三版的SQLite,又称SQLite3。这套软件有几个特色:
软件属于公共财(public domain),SQLite可说是某种「美德软件」(virtueware),作者本人放弃着作权,而给使用SQLite的人以下的「祝福」(blessing):
May you do good an ......

将图片等文件保存到sqlite中(c#)

 SqLite.net的dll为System.Data.SQLite.dll,这种dll分为32位、64位和适用于compactframework三种,在引用时要注意,选择正确的dll。
将要保存图片的字段类型设为blob。代码如下:
private void savePicture()
{
using (SQLiteConnection cnn = new SQLiteConnection(dbPath))
......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号