I just attempted to insert a .jpg image into an access 2010 database but now I want to retrieve it and now I have an error that says "parameter is not valid"
Con.Open()
Using com As New OleDbCommand("Select Picture from MyImages where ID =1", Con)
Dim imageobj = com.ExecuteScalar
If Not imageobj Is Nothing AndAlso Not imageobj Is DBNull.Value Then
Using ms As New System.IO.MemoryStream
Dim bm As Bitmap
Dim byteArray = DirectCast(imageobj, Byte())
'be aware you see here the way to remove old Ole object information
'for not northwind it is normally 0 instead of 78
ms.Write(byteArray, 78, byteArray.Length - 78)
bm = New Bitmap(ms)'>>>the error shows up here
PictureBox1.Image = bm
End Using
End If
End Using