我刚开始构建一个 Windows 窗体应用程序。登录后,执行以下代码。但问题是,每次用户登录表时都会被覆盖。怎样才能做到数据库表只创建一次呢?
SQLiteConnection sqlite_conn;
SQLiteCommand sqlite_cmd;
SQLiteDataReader sqlite_datareader;
// create a new database connection:
sqlite_conn = new SQLiteConnection("Data Source=database.db;Version=3;New=True;Compress=True;");
sqlite_conn.Open();
sqlite_cmd = sqlite_conn.CreateCommand();
sqlite_cmd.CommandText = "CREATE TABLE test (id integer primary key, text varchar(100));";
sqlite_cmd.ExecuteNonQuery();
或者有更好的方法吗?