"Invalid Parameter" error returned while retrieve img

Momo

Member
Joined
May 30, 2006
Messages
21
Programming Experience
Beginner
I'm facing the "invalid parameter" error while attempt to retrieve the photo from db and assign it to a memory stream and finally put into the picturebox. But, i found that an error of "invalid parameter" return while a couples attempt to assign the memorystream to the picturebox. As once I change or modify the variable, it will be alrights.
I googled most of web sites but fail to look for a proper solution as many people also faced the same problem as mine. Anybody have any idea of solving this problem and who has experienced or bump in this problem, how u all solve this problem. I have worked on this a fews day but no solution found.

As the code below is which I bump in this error:
ArrayImg = CType(rst4.Fields("nvcEmpPhoto").Value, Byte())
Dim ts As New System.IO.MemoryStream(ArrayImg)
Me.EmpPhotoHolder.Image = Image.FromStream(ts)
ts.close()

The bolded statement is where the error return to me.
Thanks in advanced if any solution or opinion been shared out.
 
Doesn't seem to be a whole lot wrong with that.I take it you are filling a datatable with the information from the database? The only thing i would say is that the array specifiers should be on the variable, not it's type...

VB.NET:
Dim ArrayImg() As Byte = Nothing
 
Back
Top