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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top