Interview Question in SQL Server Configurations


 

Interview Question :: Display image on web page asp.net 2.0


I'm having trouble displaying a binary image to a web page, the following code executes fine but I don't know how to display the image after Response.BinaryWrite(myReader("FileData"...

Private Sub getUserListings(ByVal UserName As String)

'display user listings
Dim myConnection As New SqlConnection(System.Configuration.Confi...

Try
Const SQL As String = "SELECT ContentType, FileData FROM dbo.tblImages"
Dim myCommand As New SqlCommand(SQL, myConnection)

myConnection.Open()
Dim myReader As SqlDataReader = myCommand.ExecuteReader

If myReader.Read Then
Response.ContentType = myReader("ContentType").ToString()
Response.BinaryWrite(myReader("FileData"...

End If

myReader.Close()
myConnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
E
Answers to "Display image on web page asp.net 2.0"
RE: Display image on web page asp.net 2.0?

this was a MCPD mock test question I wish I knew the specific answer.

Basically there is a setting on one of the ADO.net related objects that deal with binary issues
 
Vote for this answer ::  
Update Alert Setting