我想要一个图片库,但照片不是来自数据库。
我只能看到一张照片,而它应该有很多不同的照片...
<asp:Panel ID="Panel1" runat="server">
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<asp:Image ID="Image1" runat="server" /><%#Eval("resim") %>
</ItemTemplate>
</asp:Repeater>
</asp:Panel>
SqlConnection cnn = klas.baglan();
SqlCommand cmd = new SqlCommand(" Select * from aracResimler where ilanID="+ID, cnn);
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
Image[] imageArray = new Image[dr.FieldCount];
for (int i = 0; i < imageArray.Length; i++)
{
imageArray[i] = new Image();
imageArray[i].ImageUrl = "~/Resimler/800/" + dr[2].ToString();
//Response.Write(imageArray[i].ImageUrl);
Panel1.Controls.Add(imageArray[i]);
}
}
如何询问将照片放入照片库?