A
Adam
I have extensively searched for a solution. Below is my code that is
contained in an aspx. When my browser hits this aspx, I just get the
standard broken image picture. I know the data is the database is
correct because I have seen another employee retrieve it using Crystal
Reports. Can someone please tell me what I am doing wrong and offer a
suggestion to make this work? (This code does not generate errors, I
just can't the image to display.)
Adam
-----
Dim objSqlConnection As New SqlConnection
objSqlConnection.ConnectionString =
Application("ConnectionString")
Dim id As Integer
id = 1956
Dim SQLcn As New
SqlConnection(objSqlConnection.ConnectionString)
SQLcn.Open()
Dim cmd As New SqlCommand("select ImageFile from
xcultivarimages where cultivarid=" & id, SQLcn)
Dim objDS As New DataSet
Dim clsImages As New Plantware.clsCultivarImages(SQLcn, objDS)
Dim imageArray As DataRow() =
objDS.Tables(0).Select("Cultivarid = " & id)
Dim imageRow As DataRow
For Each imageRow In imageArray
Response.Expires = 0
Response.Buffer = True
Response.Clear()
Response.ContentType = "image/jpeg"
Response.BinaryWrite(imageRow("ImageFile"))
Next
contained in an aspx. When my browser hits this aspx, I just get the
standard broken image picture. I know the data is the database is
correct because I have seen another employee retrieve it using Crystal
Reports. Can someone please tell me what I am doing wrong and offer a
suggestion to make this work? (This code does not generate errors, I
just can't the image to display.)
Adam
-----
Dim objSqlConnection As New SqlConnection
objSqlConnection.ConnectionString =
Application("ConnectionString")
Dim id As Integer
id = 1956
Dim SQLcn As New
SqlConnection(objSqlConnection.ConnectionString)
SQLcn.Open()
Dim cmd As New SqlCommand("select ImageFile from
xcultivarimages where cultivarid=" & id, SQLcn)
Dim objDS As New DataSet
Dim clsImages As New Plantware.clsCultivarImages(SQLcn, objDS)
Dim imageArray As DataRow() =
objDS.Tables(0).Select("Cultivarid = " & id)
Dim imageRow As DataRow
For Each imageRow In imageArray
Response.Expires = 0
Response.Buffer = True
Response.Clear()
Response.ContentType = "image/jpeg"
Response.BinaryWrite(imageRow("ImageFile"))
Next