sqlite建库+各种

前端之家收集整理的这篇文章主要介绍了sqlite建库+各种前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

1. using (sqliteConnection cn = new sqliteConnection(
"Data Source=D://test.db;Pooling=true;FailIfMissing=false")
)
{
cn.Open();

using (sqliteCommand cmd = new sqliteCommand())
{
cmd.Connection = cn;

cmd.CommandText = "CREATE TABLE TestA(A INTEGER PRIMARY KEY,B nvarchar(20),C nvarchar(20))";
cmd.ExecuteNonQuery();

cmd.CommandText = "INSERT INTO TestA values (null,'asdfdas','dasgf')";
cmd.ExecuteNonQuery();

cmd.CommandText = "INSERT INTO TestA values (null,'電源がない','dasgf')";
cmd.ExecuteNonQuery();
}

}


"select tbl_name from sqlite_master where type='table'"


2.table重命名

alter table 旧表 renameto 新


3.取一张表的列

PRAGMA table_info(USERS)


4.取得所有表

SELECT tbl_name FROM sqlite_master WHERE type='table' "sqlite_sequence"

原文链接:/sqlite/202740.html

猜你在找的Sqlite相关文章