title: Visual Basic 2015 SQLite Update Query not working
body: <p>I used <strong>NuGet Package Manage</strong>r to install SQLite package in my Visual Basic 2015 Project so that i can use it in my application. The problem i am facing is that i have a sub in my application whose code is indicated below that i am using to update a table in SQLite but it does not update the values.</p>
  
  <p><strong>AddErrors</strong> is another sub that adds the errors that are captured by the try catch to the same SQLite database but different table and works fine. Can you tell me what i am doing wrong.</p>
  
  <p>I have tried both the commented and the uncommitted code with both not updating the database and not throwing any errors.</p>
  
  <pre><code>Public Sub PostedLink(ByVal id As String, ByVal link As String)
      Dim query As String = "UPDATE Table SET torf = 1 , link = '" &amp; link &amp; "' WHERE id = '" &amp; id &amp; "';"
      Dim affectedRows As Integer = 0
      Try
          Using con As New SQLiteConnection(connectionString)
              con.Open()
              Using cmd As New SQLiteCommand(con)
                  cmd.CommandTimeout = 20
                  cmd.CommandText = query
                  'Dim dr As SQLiteDataReader
                  'dr = cmd.ExecuteReader()
                  affectedRows = cmd.ExecuteNonQuery()
              End Using
              con.Close()
          End Using
      Catch ex As Exception
          AddErrors("Updating table", ex.ToString)
      End Try
  End Sub
  </code></pre>
  
  <p>The table i am trying to update has the following structure.</p>
  
  <pre><code>CREATE TABLE Table
  (
  id VARCHAR(100) PRIMARY KEY NOT NULL,
  text VARCHAR(100),
  link VARCHAR(254) DEFAULT "",
  torf BOOLEAN NOT NULL DEFAULT 0
  );
  </code></pre>