first of all, sorry if my title isn confusing as i dont really sure the specify description regarding what i wan to do.
Now what i trying to do is,
I getting 5 random images from the database, this is the code for me to get random 5 records from database: Dim command As New SqlCommand("SELECT TOP 5 Description,Image,ImageID FROM Properties ORDER BY ImageID", con)
and with the help of image handler to display it to 5 Images components i put in the page, lets say name it "Image1" to "Image5".
Now the question is, how do i assign the 5 diff imageID into the 5 image components?
Lets say i wan my Image1's imageID is 1, and Image2's imageID is 2.
What im doing now is assigning all the same imageID to all 5 images.
Below is how i assign the imageIDDim reader As SqlDataReader
reader = command.ExecuteReader
If reader.HasRows = True Then
Image1.ImageUrl = "GetThumbnail.aspx?ImageID=" & reader("ImageID") & " "
Image2.ImageUrl = "GetThumbnail.aspx?ImageID=" & reader("ImageID") & " "
Image3.ImageUrl = "GetThumbnail.aspx?ImageID=" & reader("ImageID") & " "
Image4.ImageUrl = "GetThumbnail.aspx
View Complete Post