如何判断是否存在某个索引的datarow
int l = 0;
for (int i = 0; i <= count; i++)
{
int currentTop = begin_top - i * step;
bool flag = currentTop != 0;
begin_html += string.Format(@"<span style=""padding-top:{0}px;"">", currentTop);
for (int j = 0; j <= i; j++)
{
try
{
begin_html += string.Format(@"<img src=""{0}""/>", dt.Rows[l]["HomeImgUrl"]);
}
catch
{
}
l++;
}
begin_html += "</span>";
}
if (!dt.Rows[l].IsNull(0))
begin_html += string.Format(@"<img src=""{0}""/>", dt.Rows[l]["HomeImgUrl"]);