// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Data.SQLite; namespace Create { public class Program { public static void Execute(SQLiteConnection con, string sqlstr) { using(SQLiteCommand cmd = new SQLiteCommand(sqlstr, con)) { cmd.ExecuteNonQuery(); } } public static void Main(string[] args) { using(SQLiteConnection con = new SQLiteConnection(@"Data Source=C:\Work\test.sqlite")) { con.Open(); Execute(con, "CREATE TABLE t1 (f1 INTEGER NOT NULL, f2 VARCHAR(50), PRIMARY KEY(f1))"); Execute(con, "INSERT INTO t1 VALUES(1,'A')"); Execute(con, "INSERT INTO t1 VALUES(2,'BB')"); Execute(con, "INSERT INTO t1 VALUES(3,'CCC')"); } } } }