Chris Johnson

Chris Johnson

  • NA
  • 41
  • 4.6k

SQL Update on a windows form

Dec 1 2021 9:33 AM

Hi all.

This is driving me nuts. I am trying to update an SQL record with a pic from a c# Windows form. I have written the code but it fails on the update command with incorrect syntax near (.

Can someone please spot what I am doing wrong?

                SqlCommand cmd = new SqlCommand("UPDATE ITMRVA (Pic) values (@Pic) where ITNBR = 'OCB75'", cnn);
                cmd.Parameters.AddWithValue("@Pic", content);
                cmd.ExecuteNonQuery();
                cnn.Close();
                MessageBox.Show("Image inserted");


Answers (4)