ASP.NET for循环为什么只显示一个?
DataTabledt=DBHelper.GetInfo("Select*fromboardswhereTYPE='"+Id+"'");if(dt.Rows.Count>...
DataTable dt = DBHelper.GetInfo("Select * from boards where TYPE='" + Id + "' ");
if (dt.Rows.Count>0)
{
for (int i = 0; i < dt.Rows.Count; i++)
{
DataTable dw = DBHelper.GetInfo("Select top 9 * from shuju where ID='" + dt.Rows[i]["SP"] + "' ");
rpt.DataSource = dw; ;
rpt.DataBind();
}
} 展开
if (dt.Rows.Count>0)
{
for (int i = 0; i < dt.Rows.Count; i++)
{
DataTable dw = DBHelper.GetInfo("Select top 9 * from shuju where ID='" + dt.Rows[i]["SP"] + "' ");
rpt.DataSource = dw; ;
rpt.DataBind();
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询