[RESOLVED] Help needed about updating SQLite database
Hello, I have a database and when I use this code it doesn't update anything.
VB.NET Code:
private void UpdateMD5Record(string fc, string md5) // Full command, md5
{
Console.WriteLine("fc = " + fc + " md5 = " + md5);
m_dbConnection.Open();
SQLiteCommand command = new SQLiteCommand("PRAGMA foreign_keys = ON", m_dbConnection);
command.ExecuteNonQuery();
string sql = "UPDATE 'tbl_programs' " +
"SET 'txt_md5' = :md5 " +
"WHERE 'txt_fullCommand' = :fc; ";
command = new SQLiteCommand(sql, m_dbConnection);
command.Parameters.AddWithValue("md5", md5);
command.Parameters.AddWithValue("fc", fc);
command.ExecuteNonQuery();
m_dbConnection.Close();
}
I don't get any errors. Here's an example output:
Quote:
fc = msiexec -i "7z1604.msi" /qn md5 = 8cfd1629f23dfdad978349c93241ef6d
Re: Help needed about updating SQLite database
Why do you use single quotes on the table and column names?
I don't think that's correct.
http://blog.christosoft.de/2012/10/s...acolumn-names/
Re: Help needed about updating SQLite database
thanks for the hint. it works fine now.