Image takes control

O

Ola Myrgart

Hi !

I have a problem how to display an image in a different page together
with some text. The image is stored in a SQL DB and the insertfunction
works well. It´s when I try to wiew the image on another side the
problem occurs. The image takes control. Here is some code.

Dim intKundID As Integer
Dim strSelect As String
Dim conn As SqlConnection
Dim cmdSelect As SqlCommand
Dim dtrReport As SqlDataReader

intKundID = Request.QueryString("id")

conn = New
SqlConnection("server=localhost;uid=sa;pwd=idioterna;database=annonser")
strSelect = "Select * from kunder where KundID=@KundID"
cmdSelect = New SqlCommand(strSelect, conn)
cmdSelect.Parameters.Add("@KundID", intKundID)

Try
conn.Open()
dtrReport = cmdSelect.ExecuteReader()

If dtrReport.Read Then
lblRubrik.Text = dtrReport("Rubrik")
lblAnnonstext.Text = dtrReport("Annonstext")
lblEpost.Text = dtrReport("Epost")
lblTelefon.Text = dtrReport("Telefon")
lblDatum.Text = dtrReport("Datum")
Response.BinaryWrite(CType(dtrReport("Image"),Byte()))
End If


How do i solve this ??
OM "Myggan"
 
S

Steve C. Orr [MVP, MCSD]

You cannot write an image directly to an HTML page. You
can only put links to images in a page.
Normally your img tag would point to a jpg or a gif image file.
In your case you'll want it to point to a special page you've designed
specifically for outputting these images.
For example:
<img src='myimage.aspx' ...>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top