title: SQLite .NET Insert ExecuteNonQuery Returns 1
body: <p>SQL:</p>
  
  <pre><code>CREATE TABLE main.LogRecord (
  Id INTEGER PRIMARY KEY  AUTOINCREMENT  NOT NULL ,
  TimeStamp DATETIME NOT NULL ,
  Type TEXT NOT NULL ,
  Severity TEXT NOT NULL ,
  Message TEXT NOT NULL ,
  Origin TEXT NOT NULL)
  
  INSERT INTO LogRecord
  (TimeStamp, Type, Severity, Message, Origins) VALUES
  (@timestamp, @type, @severity, @message, @origin)
  </code></pre>
  
  <p>C# Pseudo-ish Code:</p>
  
  <pre><code>SQLiteCommand command = new SQLiteCommand(INSERT_COMMAND_TEXT);
  command.Parameters.AddWithValue("@paramName", object.value);
  command.Connect = connectVar;
  command.ExecuteNonQuery();
  </code></pre>
  
  <p>When <code>ExecuteNonQuery()</code> runs, the value <code>1</code> is returned which according to SqliteOrg means:</p>
  
  <blockquote>
    <p><em>SQL error or missing database</em></p>
  </blockquote>
  
  <p>Except, no exception is thrown AND the data is inserted correctly.</p>
  
  <p>Is there way to get the <code>LAST_ERROR_MESSAGE</code> using <code>System.Data.SQLite</code>? I've only come across ways to get the last error message for non .net APIs.</p>
  
  <p>When I incorrectly insert to a column that does not exists the same error code (1) is returned BUT this time an exception is thrown with the last error message.</p>
  
  <p>So if the insert is working, why is 1 being returned? Any help is greatly appreciated.</p>
  
  <p>Edit: I also tried not sending the <code>TimeStamp DateTime</code> in case it was a date formatting issue but the same situation occurs.</p>
  
  <p>Edit: Turns out 1 is the # of rows affected and it's all in the documentation <a href="http://msdn.microsoft.com/en-us/library/system.data.idbcommand.executenonquery%28v=vs.80%29.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/system.data.idbcommand.executenonquery%28v=vs.80%29.aspx</a></p>