title: WPF SQLite queries exception
body: <p>There are multiple related questions but none of them solved my problem.
  I have a C# (WPF) Application which connects to a sqlite database. There are 2 model classes - Dealer and Order and 2 corresponding tables in the Database.</p>
  
  <p>I am able to do CRUD operations in <em>Dealer</em> table but when trying to do the same in <em>Order</em> table, I get an Exception - <em>SQL Logic error or missing database</em>. I am pasting some of the related code:</p>
  
  <p><strong>For Dealer</strong></p>
  
  <pre><code>using(SQLiteConnection conn = new SQLiteConnection(connectionString)) {
  conn.Open();
  using(SQLiteCommand cmd = new SQLiteCommand(conn)) {
    cmd.CommandText = "INSERT INTO Dealer(name, address, contact, note) VALUES (@Name, @Address, @Contact, @Note)";
    cmd.Prepare();
    cmd.Parameters.AddWithValue("@Name", dealer.Name);
    cmd.Parameters.AddWithValue("@Address", dealer.Address);
    cmd.Parameters.AddWithValue("@Contact", dealer.Contact);
    cmd.Parameters.AddWithValue("@Note", dealer.Note);
    try {
     result = cmd.ExecuteNonQuery();
    }
  </code></pre>
  
  <p><strong>For Order</strong></p>
  
  <pre><code>using(SQLiteConnection conn = new SQLiteConnection(connectionString)) {
  conn.Open();
  using(SQLiteCommand cmd = new SQLiteCommand(conn)) {
    cmd.CommandText = "INSERT INTO Order(dealer_id, note) VALUES (@DealerId, @Note)";
    cmd.Prepare();
    cmd.Parameters.AddWithValue("@DealerId", order.DealerId);
    cmd.Parameters.AddWithValue("@Note", order.Note);
    try {
     result = cmd.ExecuteNonQuery();
    }
  </code></pre>
  
  <p>I get the exception at <code>cmd.ExecuteNonQuery();</code> statement for Order.</p>
  
  <p>I have cross verified column name spellings and tried <code>SELECT * FROM Order</code> which again returned the same exception.</p>
  
  <p>I also tried <code>SELECT name FROM sqlite_master WHERE type='table' AND name='Order';</code> from the <strong>For Order</strong> code above to check if table exists and it returned the correct table name.</p>
  
  <p>Please help. Thanks in advance.</p>