Get Image from mdb file "Parameter is not valid."

Joined
Feb 11, 2007
Messages
1
Reaction score
0
Hello!
I have an OLE Object in my table, that may be jpg, doc, xml file.
In case of jpg I'd like to show it (VS2005 Visual basic).
I did next (not full code):

Dim ms AsNew MemoryStream()
Dim reader As OleDbDataReader = cmd.ExecuteReader(CommandBehavior.SequentialAccess)
reader.Read()
retval = reader.GetBytes(0, 0, outbyte, 0, bufferSize)
ms.Write(outbyte, 0, retval)
ms.Seek(0, SeekOrigin.Begin)
curImage = Image.FromStream(ms,False)----> error "
Parameter is not valid."

I do not see the fault. Please help
 
Back
Top