i try to put picture in mysql with vb.net, first i convert with this function :
Public Function convertImage(ByVal myImage As Image) As Byte()
Dim mStream As New MemoryStream()
myImage.Save(mStream, System.Drawing.Imaging.ImageFormat.Jpeg)
Dim myBytes(mStream.Length = 1) As Byte
mStream.Position = 0
mStream.Read(myBytes, 0, mStream.Length)
Return myBytes
End Function
i try to use that function for storing picture to mysql database :
INSERT INTO myImage (image) VALUES ('" & convertImage(PictureBox1.image) & "');
and then i have this error :
Operator '&' is not defined for types 'String' and '1-dimensional array of Byte'
i create a table (myImage) with image field (LongBlob)
need your help with that error please!