打开数据库:
SQLiteConnection db = null; private string fileName = "System.DB"; if (db == null) { db = new SQLiteConnection(fileName); db.Open(); }
建表:
SQLiteCommand cmd = db.CreateCommand("Create table Banji (ClassNumber text,Teacher text,Introduction text)"); int i = cmd.ExecuteNonQuery();
插入数据:
cmd.CommandText = "Insert into Banji (ClassNumber,Teacher,Introduction) values (@ClassNumber,@Teacher,@Introduction)"; rec = cmd.ExecuteNonQuery(banji);
更新数据:
UPDATA Banji SET ClassNumber = '2010' WHERE ClassNumber ='2011'