title: Inserting into SQLite database with parameters from vb.net
body: <p>I want to insert list items into a SQLite3 database with parameters, but it doesn't work.. and I don't even get any errors. </p>
  
  <p>Here is my code:</p>
  
  <pre><code>strSQL = "insert into tbltrans2 (transid, flddate, itemcode, itemname, qty, price, total, btw, btwper) values ( ?,?,?,?,?,?,?,?,?)"
  Using cn As New SQLiteConnection("Data Source=" + Application.StartupPath + "\POS.s3db; Version=3;"), _
      cmd As New SQLiteCommand(strSQL, cn)
  
      cmd.Parameters.Add("?", DbType.String).Value = txtTransId.Text
      cmd.Parameters.Add("?", DbType.Date).Value = txtDate.Text
      cmd.Parameters.Add("?", DbType.Double)
      cmd.Parameters.Add("?", DbType.Double)
      cmd.Parameters.Add("?", DbType.Double)
      cmd.Parameters.Add("?", DbType.Double)
      cmd.Parameters.Add("?", DbType.Double)
      cmd.Parameters.Add("?", DbType.Double)
      cmd.Parameters.Add("?", DbType.Double)
  
      cn.Open()
      For Each ls As ListViewItem In ListItems.Items
          cmd.Parameters(2).Value = ls.Tag
          cmd.Parameters(3).Value = ls.SubItems(0).Text
          cmd.Parameters(4).Value = (ls.SubItems(1).Text)
          cmd.Parameters(5).Value = (ls.SubItems(2).Text)
          cmd.Parameters(6).Value = (ls.SubItems(3).Text)
          cmd.Parameters(7).Value = (Double.Parse(ls.SubItems(5).Text) / 100) * (Double.Parse(ls.SubItems(3).Text)).ToString("#,##0.00")
          cmd.Parameters(8).Value = Double.Parse(ls.SubItems(5).Text)
  
          cmd.ExecuteNonQuery()
          MsgBox(strSQL)
       Next ls
       cn.Close()
   End Using
  </code></pre>