Boris Aro

Boris Aro

  • NA
  • 3
  • 0

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

Feb 11 2007 6:35 AM
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