title: SQLite Parameterized UPDATE
body: <p>Have a weird scenario where the ADO.Net keep returning "SQLite error. Insufficient parameters supplied to the command"</p>
  
  <p>The UPDATE Query:</p>
  
  <pre><code>UPDATE [Device] SET
  [DeviceSerial] = @DeviceSerial,
  [RegistrationDate] = @RegistrationDate,
  [RegistrationNumber] = @RegistrationNumber,
  [Password] = @Password,
  [Make] = @Make,
  [Year] = @Year,
  [OdometerStart] = @OdometerStart,
  [PurchaseValue] = @PurchaseValue,
  [Closed] = @Closed
  WHERE [DeviceId] = @DeviceId
  </code></pre>
  
  <p>Parameters:</p>
  
  <pre><code>{ "@DeviceSerial", this.DeviceSerial }, 
  { "@RegistrationDate", this.RegistrationDate }, 
  { "@RegistrationNumber", this.RegistrationNumber }, 
  { "@Password", this.Password }, 
  { "@Make", this.Make }, 
  { "@Year", this.Year }, 
  { "@OdometerStart", this.OdometerStart }, 
  { "@PurchaseValue", this.PurchaseValue }, 
  { "@Closed", this.Closed }, 
  { "@DeviceId}", this.DeviceId } 
  </code></pre>
  
  <p>My DataHandler Method:</p>
  
  <pre><code>public static bool CallSqlText(string sqlStatement, Dictionary&lt;string, object&gt; parameters)
          {
              ConnectionCheck();
              try
              {
                  var cmd = conn.CreateCommand();
                  cmd.CommandType = CommandType.Text;
                  cmd.CommandText = sqlStatement;
                  foreach (var item in parameters)
                  {
                      cmd.Parameters.AddWithValue(item.Key, item.Value);
                  }
                  return (cmd.ExecuteNonQuery() &gt; 0);
              }
              catch { }
              return false;
          }
  </code></pre>