I tried to save the image from the picturebox to the dataset and it always show the error "A generic error occurred in GDI+" in the second line which saving the pic to memory stream.

my codes are:
Dim tmpStream As New MemoryStream()
Me.PictureBox1.Image.Save(tmpStream, ImageFormat.Jpeg)
Dim BLOBData(tmpStream.Length - 1) As Byte
tmpStream.Position = 0
tmpStream.Read(BLOBData, 0, tmpStream.Length)
dr_teacher("ti_photo") = BLOBData


Anyone knows whats wrong? And how can I "clear" the image in the picturebox dynamically in code?

Regards,
Calvin