Hi,
I am storing images in my database, where I am using 3 columns for each image, 1. imageName as an nvarchar(50), 2. imageData as an image, and 3. imageType as an nvarchar(100).
I have successfully inserted the images into the database, only problem that I am having is that I am unable to do any sort of compression on the images, but thats a different problem. The issue that I am having is that if I try and retrieve two images from the database and display them at the same time, in some cases only 1 image is displayed while in other cases no image is displayed.
To display the images, I have created a web control with two html image controls with runat="server", both these controls have the image url set to a different .aspx page which use the following code to retrieve the image from the database and display it:
In the event that the images dont display, I have manually gone to the pages which runs the above code, and I have confirmed that the code is running correctly and displaying the images.
Any suggestions on how to correct this problem? I think that it may be down to the size of the images, so they are causing some sort of timeout during execution of my code, but I cannot be positive.
Mike55.
I am storing images in my database, where I am using 3 columns for each image, 1. imageName as an nvarchar(50), 2. imageData as an image, and 3. imageType as an nvarchar(100).
I have successfully inserted the images into the database, only problem that I am having is that I am unable to do any sort of compression on the images, but thats a different problem. The issue that I am having is that if I try and retrieve two images from the database and display them at the same time, in some cases only 1 image is displayed while in other cases no image is displayed.
To display the images, I have created a web control with two html image controls with runat="server", both these controls have the image url set to a different .aspx page which use the following code to retrieve the image from the database and display it:
Code:
Private Sub LoadImage()
Dim myReader As Byte()
Dim content As String = String.Empty
myReader = dbConnection.RetrievePhoto(Request.QueryString("pid").ToString, 0, content)
Try
Response.ContentType = content
If Not myReader Is Nothing Then
Response.BinaryWrite(myReader)
Else
Response.WriteFile("images/Notfound.jpg")
End If
Catch ex As Exception
End Try
End Sub
In the event that the images dont display, I have manually gone to the pages which runs the above code, and I have confirmed that the code is running correctly and displaying the images.
Any suggestions on how to correct this problem? I think that it may be down to the size of the images, so they are causing some sort of timeout during execution of my code, but I cannot be positive.
Mike55.