I worked out this code in another thread (thanks Mendhak!)
Just to prove that I could display images from a database.Code:Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim dcn As New SqlConnection dcn.ConnectionString = "Server=fps-lap-sz\sqlexpress; Initial Catalog=Stufiles; Integrated Security=SSPI" Try dcn.Open() Dim drc As New SqlCommand drc.Connection = dcn drc.CommandType = Data.CommandType.StoredProcedure drc.CommandText = "GetStuPhoto_P" drc.Parameters.Add(New SqlParameter("@StuId", Data.SqlDbType.VarChar, 255, Data.ParameterDirection.Input _ , False, 0, 0, "", Data.DataRowVersion.Default, Request.QueryString("imageid"))) Dim bytArrayContent As Byte() = DirectCast(drc.ExecuteScalar, Byte()) 'bytArrayContent = CType(dr.Item("ImageField"), Byte()) Response.ContentType = "image/jpeg" Response.OutputStream.Write(bytArrayContent, 0, bytArrayContent.Length) Response.End() txtMessage.Text = "Student Displayed!" Catch ex As Exception txtMessage.Text = "Student Not Found!" End Try
Now I want to change it so that the stored procedure GetStuPhoto_P returns many images.
I would like to display several horizontally on the page (like 3 maybe) and then repeat each row until all images are show.
With maybe the student name under each image.
So I started changing this to have an IMAGE CONTROL - thinking that would be needed. But I've got no idea how to bind that to a datareader - there is no DATASOURCE property.
And the REPEATER info in the VS help files is not too clear (I've never done web/asp work - so this is all new to me).
Any help or direction would be appreciated.




Reply With Quote