Displaying image in pictureBox direct from database
You can display image directly from database into picture box.
//Declaring byte array
Byte[] bImage = new Byte[0];
//Casting photo data and holding in byte type variable
//dr is DataRow and "CPhoto" is name of column.
bImage = (Byte[])(dr["CPhoto"]);
//Creating object of MemoryStream
System.IO.MemoryStream msData = new System.IO.MemoryStream(bImage);
//Displaying image in picturebox from memorystream object
pboClient.Image = System.Drawing.Image.FromStream(msData);
