SQL images in ASP.NET control?

Hernan B

New member
Hi,

I have been trying to retrieves images from a SQL SERVER database and show them in a ASP.NET website…


I succeed using Response.BinaryWrite but it is displayed throught the whole page and everything else just disappear… and that’s not what I need….

------------------------------------------------
Public Sub carga()
Dim strImageID As String = Request.QueryString("id")
Dim myConnection As New SqlConnection("Data Source=INTEGRA-TS;Initial Catalog=Integra;User ID=sa;Password=Gessa2009")
Dim sSQL As String = "SELECT Fotografia FROM Integra.Personas WHERE Cedula ='105250392'"
Dim myCommand As New SqlCommand(sSQL, myConnection)
Try
myConnection.Open()
Dim myDataReader As SqlDataReader
myDataReader = myCommand.ExecuteReader(CommandBehavior.CloseConnection)
Do While (myDataReader.Read())
Response.ContentType = "image/JPEG"
Response.BinaryWrite(myDataReader.Item("Fotografia"))
Loop
myConnection.Close()
Catch SQLexc As SqlException
End Try
End Sub
---------------------------------------------------


This is a webpage for human resources department and they want to see the image and also the rest of the details about the persons..

Please help

I did a search in some ASP.NET forums they just shows ”photo albums” or “Slide Shows” and that’s not what I need..

I need to fecth images and place them into a asp control like IMAGE or IMAGE MAP

GOD BLESS YOU !!!!!!
 
Back
Top