I am using following code to save my data to database Where does the statement to save a picture in the database fit?
Dim drNewRowMCQsAns As DataRow
Well, the image data is simply a byte array
Dim imageData as Byte()
Load your image into the byte array from where ever you are getting it from and set it just like the other properties
drNewRowMCQsAns.Item("ImageData") = imageData
Loading image into array:
From file:
imageData = IO.File.ReadAllBytes("c:\filename.jpg")
From bitmap:
Dim bitmap As New System.Drawing.Bitmap("c:\filename.jpg")
Dim tempMemStream As New IO.MemoryStream
bitmap.Save(tempMemStream, System.Drawing.Imaging.ImageFormat.Jpeg)
imageData = tempMemStream.ToArray()