SQLite update query works in console, not in .Net
<p>I am using an SQLite database in my application. For some reason the query:</p>

<pre><code>    UPDATE USERS SET PASSWORD = 'test' WHERE USERNAME = 'Admin'
</code></pre>

<p>works in console (updates the PASSWORD field), but when I run it via code:</p>

<pre><code>Dim exec As String = "UPDATE USERS SET PASSWORD = '" &amp; password &amp; "' WHERE USERNAME = '" &amp; username &amp; "'"
Dim returnCode As [Boolean] = True
Try
    ExecuteNonQuery(exec)
Catch
    returnCode = False
End Try
Return returnCode
</code></pre>

<p>The function always returns false, and the database is not updated. Here is the ExecuteNonQuery method:</p>

<pre><code>Public Shared Function ExecuteNonQuery(sql As String) As Integer
    Dim cnn As New SQLiteConnection(dbConnection)
    cnn.Open()
    Dim mycommand As New SQLiteCommand(cnn)
    mycommand.CommandText = sql
    Dim rowsUpdated As Integer = mycommand.ExecuteNonQuery()
    cnn.Close()
    Return rowsUpdated
End Function
</code></pre>

<p>What am I doing wrong here? My code for creating a new row works fine, but updating doesn't.</p>

<p>Yes, I am aware this is unsafe, I originally had a bunch more safety checks, but I need to at least get it to work before doing so.</p>