Sunday, 28 April 2013

How to store and retrieve images in sql server database through VB.NET? | VB.Net Interview Questions

To store image in database 1st u need to make table like this
CREATE TABLE PicImage
   (
    Picid int,
    Pic Image
    )
Now in vb.net coding u have to write code like this
Dim ms As New MemoryStream
pic_photo.Image.Save(ms, pic_photo.Image.RawFormat)
arrImage = ms.GetBuffer
ms.Flush()
Now pass arrImage in your insert query.

No comments: