Results 1 to 3 of 3

Thread: [RESOLVED] Help needed about updating SQLite database

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2013
    Posts
    200

    Resolved [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:
    1. private void UpdateMD5Record(string fc, string md5) // Full command, md5
    2. {
    3.     Console.WriteLine("fc = " + fc + "    md5 = " + md5);
    4.     m_dbConnection.Open();
    5.  
    6.     SQLiteCommand command = new SQLiteCommand("PRAGMA foreign_keys = ON", m_dbConnection);
    7.     command.ExecuteNonQuery();
    8.  
    9.     string sql =    "UPDATE 'tbl_programs' " +
    10.                     "SET 'txt_md5' = :md5 " +
    11.                     "WHERE 'txt_fullCommand' = :fc; ";
    12.     command = new SQLiteCommand(sql, m_dbConnection);
    13.     command.Parameters.AddWithValue("md5", md5);
    14.     command.Parameters.AddWithValue("fc", fc);
    15.     command.ExecuteNonQuery();
    16.     m_dbConnection.Close();
    17. }

    I don't get any errors. Here's an example output:

    fc = msiexec -i "7z1604.msi" /qn md5 = 8cfd1629f23dfdad978349c93241ef6d

  2. #2
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    6,735

    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/

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 2013
    Posts
    200

    Re: Help needed about updating SQLite database

    thanks for the hint. it works fine now.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width