如果我尝试将图像转换到一个数组,然后运行更新查询和插入字符串更新变换的图像矩阵我得到的错误:UPDATE查询图像
the + operator is not defined for types 'String' and 'matrix' 1-byte size
代码:
data1 = textbox
data2 = TextBox2
using ms as new MemoryStream()
DirectCast (picturebox1.image, botmap) .save (ms currentFormat)
image = ms.toArray()
end using
Dim param as 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
我该如何解决它?
我们如何才能帮助您,而无需查看代码中所做的工作? – Haris 2014-10-27 09:48:10
这是什么?发布你已经有的代码来帮助人们回答你的问题。 – Joeblade 2014-10-27 09:48:25
代码是:DATA1 =文本框 DATA2 = TextBox2中使用MS作为新的MemoryStream () DirectCast(picturebox1.image,botmap).save(MS currentFormat) 图像= ms.toArray()使用 昏暗PARAM 端as 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 – 2014-10-27 09:53:14