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