如何使用循环在sqldatareader中包含imagecontrol

时间:2016-03-11 18:32:45

标签: asp.net

SqlConnection cnn = klas.baglan();

SqlCommand cmd = new SqlCommand(" Select * from aracResimler where ilanID=3028", 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 = "~/Images/800/" + dr[2].ToString();

        Panel1.Controls.Add(imageArray[i]);

        }

    }

我看不到我得到的图片包括panel1

0 个答案:

没有答案