我无法将MySQL longblob字段中的图像检索到VB.net图片框。这是我看到的错误:
...这是我正在使用的代码:
Dim CmdString As String = "INSERT INTO employeesmaster (name, image) VALUES(@name, @image)"
Dim cmd = New MySqlCommand(CmdString, MyConnection)
cmd.Parameters.Add("@name", MySqlDbType.VarChar)
cmd.Parameters.Add("@Image", MySqlDbType.LongBlob)
cmd.Parameters("@name").Value = Me.TextBox1.Text
cmd.Parameters("@image").Value = Me.PictureBox1.Image
Dim RowsAffected As Integer = cmd.ExecuteNonQuery()
If RowsAffected > 0 Then
MsgBox("Image saved")
End If