Author: sadiyarani | Posted on: 3/5/2010 4:14:48 AM | Views : 472

I write the following code but there is an error. Pls help me.I just want to retrive the image which I have save into tha database from the sql server and to display in the picture Box(image)
Dim data As Byte() Dim rootpath As String con2_tmp.Open() Dim mycommand As New SqlCommand("Select PhotoFile from lInfo where in = '" & Trim(Me.lblin.Text) & "'", con2_tmp) Dim dr As SqlDataReader = mycommand.ExecuteReader() If dr.Read() Then data = CType(dr("PhotoFile"), Byte()) Dim mstream As New System.IO.MemoryStream() mstream.Write(data, 0, data.Length) Dim bmp As New System.Drawing.Bitmap(mstream) bmp.Save(Server.MapPath("sample.jpeg"), System.Drawing.Imaging.ImageFormat.Jpeg)///error occur here mstream ...

Go to the complete details ...