Shivaraj Poojary

Shivaraj Poojary

  • NA
  • 92
  • 314.2k

how to retrieve image

Nov 23 2010 4:12 AM
Hiii..............i want to know how to retrieve image from database to picturebox..The image which is in the database is stored in binary format.i have the following code to store the image into database...
  byte[] data = null;
                FileInfo fi = new FileInfo(txtFile.Text);
                long numBytes = fi.Length;
                FileStream fstream = new FileStream(txtFile.Text, FileMode.Open, FileAccess.Read);
                BinaryReader br = new BinaryReader(fstream);
                data = br.ReadBytes((int)numBytes);

i want the code to retrieve image...i have a picturebox named picEmloyee and the table named TB_Employee ....i tried it many ways but getting error...plz help me

Answers (1)