sql server - Query SQL update column image -
sql server - Query SQL update column image -
i'm testing next query update columns in sql server database, reporting next code:
data1 = textbox data2 = textbox2 using ms new memorystream () directcast (picturebox1.image, botmap) .save (ms currentformat) image = ms.toarray () end using dim param sqlparameter () = _ new sqlparameter () {new sqlparameter ("@ data1", _ data1), new sqlparameter ("@ data2", data2), new sqlparameter ("@ image", image)} mcmd.commandtext = "update set table column1 = '" + data1 + "', column2 '" + data1 + "'" mcmd.parameters.add ("@ image", sqldbtype.varbinary, 8000) .value = image
the line of code updates values data1
, data2
image not updated
how can prepare this?
look @ update
statement below; doesn't looks right @ syntactically, , missing =
after column2
mcmd.commandtext = "update set table column1 = '" + data1 + "', column2 '" + data1 + "'"
it should be
mcmd.commandtext = "update table_name set column1 = '" + data1 + "', column2 = '" + data2 + "'"
also, have declared parameters values, utilize them in update
statement
mcmd.commandtext = "update table_name set column1 = @data1, column2 = @data2
sql sql-server image sql-update
Comments
Post a Comment