C# helps error with sqlite

Asked

Viewed 37 times

2

Where is the error ? does not update at all

SQLiteConnection conn = new SQLiteConnection(conexao);
if (conn.State == ConnectionState.Closed)
      conn.Open();
SQLiteCommand cmd = new SQLiteCommand("UPDATE PESSOAS SET NOME,ADDRESS = @NOME,@ADDRESS  WHERE ID = @CODIGO", conn);
cmd.Parameters.AddWithValue("CODIGO",IDregistro);
cmd.Parameters.AddWithValue("NOME", textBox1.Text);
cmd.Parameters.AddWithValue("ADDRESS", textBox2.Text);
try
{
      cmd.ExecuteNonQuery();
      MessageBox.Show("Registro Atualizado Com sucesso");

1 answer

3


Your SQL is wrong, example:

UPDATE PESSOAS SET NOME = @NOME, ADDRESS = @ADDRESS WHERE ID = @CODIGO

Reference SQL UPDATE Statement

  • Thanks worked out I got caught up in this !

  • If the answer to your question @carloscoelho accepted as answer!

  • 1

    I’m waiting for the 6 minutes here it says so you can only accept an answer in 6 minutes,I’m waiting

Browser other questions tagged

You are not signed in. Login or sign up in order to post.