I'm using SQLite with C# and have some tables with foreign keys defined.
Now, I know that by default foreign key constraints are not enforced in SQLite, but I'd like to turn them ON.
Is it possible to do this through code? I have looked up a related question, but I'm not sure how to do it through C# code. I'm using the latest plug-in of SQLite available for Visual Studio 2008 for designing my tables.
conn.Open();
SQLiteCommand cmd = new SQLiteCommand("PRAGMA foreign_keys = ON", conn);
cmd.ExecuteNonQuery();
conn.Close();
I need this change to persist when this connection is reopened. Is it possible?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…