title: C# with SQLite and foreign key
body: <p>I want to implement a patients data base for our software, and have an issue with the foreign key statement. I am using the latest SQLite DLLs, with C#.</p>
  
  <p>When I try to run below code:</p>
  
  <pre><code>dbConnection = "Data Source=SQLiteMyDatabase.db;foreign keys=true;";
  if (connections == 0)
  {
    cnn = new SQLiteConnection(dbConnection);
    cnn.Open();
    this.ExecuteNonQuery("CREATE TABLE IF NOT EXISTS patients ( id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name VARCHAR(100) NOT NULL;");
    this.ExecuteNonQuery("CREATE TABLE IF NOT EXISTS images ( FOREIGN KEY (patientID) REFERENCES patients(id), nameRed VARCHAR(20) NOT NULL PRIMARY KEY;");
  }
  </code></pre>
  
  <p>I get the error:</p>
  
  <pre><code>SQLite error near "FOREIGN": syntax error
  </code></pre>
  
  <p>Why does this happen?</p>