A
A_PK
Could anyone pls guide me what is wrong with my Update Command
Dim signbyte As Byte()
signbyte = GetByteArray() ' i create this function to return
ByteArray
Try
Dim cmd As New SqlCeCommand
cmd.Connection = myConnection
' Someone give me the following insert statement....this ?
parameter is working,
'but I modify to update statement with @ or ?, both not
working....
'cmd.CommandText = "insert into test (picture) values (?)"
cmd.CommandText = "UPDATE bm00ts0001 SET imgarray = ? WHERE tid
= '" & vartid & "'"
Dim param As SqlCeParameter = cmd.Parameters.Add("imgarray",
SqlDbType.Image)
param.Value = signbyte
myConnection.Open()
cmd.ExecuteNonQuery()
myConnection.Close()
Catch sqex As SqlCeException
MessageBox.Show(sqex.ToString(), "DB operation failed")
Catch er As Exception
MessageBox.Show(er.ToString)
End Try
Dim signbyte As Byte()
signbyte = GetByteArray() ' i create this function to return
ByteArray
Try
Dim cmd As New SqlCeCommand
cmd.Connection = myConnection
' Someone give me the following insert statement....this ?
parameter is working,
'but I modify to update statement with @ or ?, both not
working....
'cmd.CommandText = "insert into test (picture) values (?)"
cmd.CommandText = "UPDATE bm00ts0001 SET imgarray = ? WHERE tid
= '" & vartid & "'"
Dim param As SqlCeParameter = cmd.Parameters.Add("imgarray",
SqlDbType.Image)
param.Value = signbyte
myConnection.Open()
cmd.ExecuteNonQuery()
myConnection.Close()
Catch sqex As SqlCeException
MessageBox.Show(sqex.ToString(), "DB operation failed")
Catch er As Exception
MessageBox.Show(er.ToString)
End Try