Click to See Complete Forum and Search --> : need help in image retrieval


SArsalan
May 1st, 2011, 01:32 AM
Hi
i am completely new to C Sharp and trying to learn it...
i am facing problem in retrieving images from my database and showing it in a picture box..
i did get the code on-line for converting the byte data to an image but have no idea how to pass an argument to it...
actually i know how data adapters and data sets can hold simple character data from the DataBase but have no idea about accessing the data stored in image column..
i did try data reader but couldn't read the bytes.

the code for byte to image conversion is this one:


public Image byteArrayToImage(byte[] byteArrayIn)
{
MemoryStream ms = new MemoryStream(byteArrayIn);
Image returnImage = Image.FromStream(ms);
return returnImage;
}



P.S: i dont know much about C# so plz keep it simple :)