Retrieving an image from the database
Posted: Sat Sep 27, 2014 6:59 pm
I am trying to retrieve my image from the database.
here is what I have so far.
Now how do I take it from the bytearray to a vintasoft image ready to be displayed?
here is what I have so far.
Code: Select all
// retrieves the row in the MemberPhoto table as an object
memberPhoto = Repository.GetMemberPhoto(currentMember.SocSecNo);
if (memberPhoto != null) // verifies the valid row was retrieved
{
byte[] data = memberPhoto.Photo; // retrieves the image from the field in the object and assigns it to a byte Array
image = VintasoftImage.FromStream(new MemoryStream(data));
DisplayPhoto(image);
}