Your image seems to be stored as binary data in the database.
YOUR WEB FORM ASPX PAGE:
<asp

ataGrid Runat="server" ID="DataGrid1">
<Columns>
<asp:TemplateColumn >
<ItemTemplate>
<asp:image runat="server" ID="imgMyImage" />
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp

ataGrid>
YOUR WEB FORM CODE BEHIND:
Private ImageIndex As Integer = 0
Private Sub DataGrid1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles DataGrid1.ItemDataBound
If e.Item.ItemType <> ListItemType.Header And e.Item.ItemType <> ListItemType.Footer Then
Dim MyImage As System.Web.UI.WebControls.Image = e.Item.FindControl("imgMyImage")
MyImage.ImageUrl = "ShowImage.aspx?index=" & ImageIndex & "&ImageType=jpeg"
Dim bytes() As Byte = DataBinder.Eval(e.Item.DataItem, "MyDataBaseFieldNameForTheImage")
Session("ImageBytes" & ImageIndex) = bytes
ImageIndex = ImageIndex + 1
End If
End Sub
YOUR SHOWIMAGE.ASPX PAGE
'Nothing to add the ASPX portion of the page
YOUR SHOWIMAGE.ASPX CODE BEHIND
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim outPutFormat As System.Drawing.Imaging.ImageFormat
Dim contType As String
Dim Index As Integer = Request.QueryString("index")
Dim ImageType As String = Request.QueryString("imagetype")
Select Case ImageType
Case "png"
outPutFormat = System.Drawing.Imaging.ImageFormat.Png
contType = "image/png"
Case "jpg"
outPutFormat = System.Drawing.Imaging.ImageFormat.Jpeg
contType = "image/jpeg"
Case "gif"
outPutFormat = System.Drawing.Imaging.ImageFormat.Png
contType = "image/gif"
End Select
Dim bytes() As Byte = Session("ImageBytes" & Index)
Dim stmMemory As IO.MemoryStream = New IO.MemoryStream(bytes)
Response.Clear()
Response.ContentType = contType
stmMemory.WriteTo(Response.OutputStream)
Response.End()
End Sub
NOTES:
It is better on the ShowImage page to pass it some information to access the Bytes[] directly from the database. I used Session Variables to simplify the concept but that would not be the best use of memory to use Session Variables unless the images are just small thumbnails.