title: Programmatically create sqlite db if it doesn't exist?
body: <p>I am trying to create an sqlite db programmatically if it doesn't exist. I have written the following code but I am getting an exception at the last line.</p>
  
  <pre><code>if (!System.IO.File.Exists("C:\\Users\\abc\\Desktop\\1\\synccc.sqlite"))
  {
      Console.WriteLine("Just entered to create Sync DB");
      SQLiteConnection.CreateFile("C:\\Users\\abc\\Desktop\\1\\synccc.sqlite");
      string sql = "create table highscores (name varchar(20), score int)";
      SQLiteCommand command = new SQLiteCommand(sql, sqlite2);
      command.ExecuteNonQuery();
  }
  sqlite2 = new SQLiteConnection("Data Source=C:\\Users\\abc\\Desktop\\1\\synccc.sqlite");
  </code></pre>
  
  <p>I get the exception at the line <code>command.ExecuteNonQuery();</code> The exception is <code>Invalid operation exception was unhandled</code>. Is there any other way to add an sqlite file to your project? Can I do it manually? If not then how can I solve the above issue?</p>