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");

Jignesh KumarRank #91 · 22.9K reputationPosted Dec 1, 2021, 6:45 AM EST
Vikas PanwarRank #1,447 · 1.1K reputationPosted Dec 1, 2021, 6:08 AM EST
geetha geethaRank #7,130 · 248 reputationPosted Dec 1, 2021, 7:08 AM EST
Yazhini MP128 reputationPosted Dec 7, 2021, 3:45 AM EST