4
Answers

SQL Update on a windows form

Chris Johnson

Chris Johnson

3y
831
1

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)