New Posts New Posts RSS Feed: Ideablade and image data type in SQL Server
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Ideablade and image data type in SQL Server

 Post Reply Post Reply
Author
BillG View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 05-Dec-2007
Location: Monroe, MI
Posts: 233
Post Options Post Options   Quote BillG Quote  Post ReplyReply Direct Link To This Post Topic: Ideablade and image data type in SQL Server
    Posted: 09-Jan-2009 at 11:12am
I have a table that has a image data type.  Object mapper sees it as a byte[].
 
Here is my code to retrieve it.
 

RdbQuery query = new RdbQuery(typeof(MemberDocument));

query.AddClause(MemberDocument.DocumentIdEntityColumn, EntityQueryOp.EQ, id);

MemberDocument document = myPM.GetEntity<MemberDocument>(query);

byte[] imageData = document.DocumentImage;

MemoryStream mem = new MemoryStream(imageData);

return mem;

In my form I have the following

MemoryStream mem = myController.GetScannedImageById(id);

pictureBox1.Image = Bitmap.FromStream(mem);

I keep getting a parameter not valid when it tries to display it in the picture box.  Am I retrieving it properly and assigning it properly to a memorystream?
 
Bill
 
Back to Top
BillG View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 05-Dec-2007
Location: Monroe, MI
Posts: 233
Post Options Post Options   Quote BillG Quote  Post ReplyReply Direct Link To This Post Posted: 09-Jan-2009 at 1:56pm
Resolved the problem.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down