Professional Documents
Culture Documents
To store an image in to sql server, you need to read image file into a byte arra
y. Once you have image data in byte array, you can easity store this image data
in sql server using sql parameters. Following code explains you how to do this.
Once you have image data in grid, get image data from grid cell. Alternatively y
ou can also get image data from Dataset table cell.
//Store image to a local file.
pictureBox1.Image.Save("c:\test_picture.jpg",
System.Drawing.Imaging.ImageFormat.Jpeg);
If you want you can extend this code to save image from Picture Box to a local i
mage file.
//Store image to a local file.
pictureBox1.Image.Save("c:\test_picture.jpg",System.Drawing.Imaging.ImageFor
mat.Jpeg);