日期:2014-05-18  浏览次数:20504 次

紧急问题!请帮忙 图片循环显示问题

string   strTuPian13= "select   top   10   *   from   DocumentFile   where   childLanmuId=104   and   fileDel=1 ";
DataSet   dsTuPian13=this.HrbGetDataSet(strTuPian5);  
this.Image13.ImageUrl= "../hrbweb/upload/manage/ "+dsTuPian13.Tables[0].Rows[0][ "File_new_FileName "].ToString();

我这样写的一段代码   我想实现的就是   一个Image   怎么把我的结果集里的   10个图片循环显示出来   谢谢大家

------解决方案--------------------
string strTuPian13= "select top 10 * from DocumentFile where childLanmuId=104 and fileDel=1 ";
DataSet dsTuPian13=this.HrbGetDataSet(strTuPian5);
foreach(DataRow dr in dsTuPian13.Table[0].Rows){
labImg.Text += string.Format( " <img src= '../hrbweb/upload/manage/{0} '> ",dr[ "File_new_FileName "])
}


html:
<asp:label id= "labImg " ruant= "server "> </asp:label>
------解决方案--------------------
改一下
for(int i=0;i <dsTuPian13.table[0].rows.count;i++)
{
name+= "/ "+dsTuPian13.table[0].rows[i][ "File_new_FileName "].ToString();
}
Response.Writer( " <script> Fimgname( ' "+name.SubString(1)+ " ') </script> ");//