I am getting trouble on how to give image name which is selected from the hardcoded value as below.
cmd = new SqlCommand("insert into Images(Image)", conn);
cmd.CommandType = CommandType.Text;
cmd.Parameters.Add("@img", SqlDbType.Image).Value = img;
It throws an exception in line one, and it says
“)” incorrect syntax.
I just want to put the value img as in 3rd line to the Images table which has 3 columns viz Id, Name and Image. I want to insert the image(img) into Image column which is of image datatype.
Please help me 🙁
You have an invalid
INSERTsyntax. try this,one more thing,
imgmust be byte array.