1
Answer

how to retrieve image

Shivaraj Poojary

Shivaraj Poojary

14y
1.7k
1
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)