我想显示我的复选框列表中的每个复选框的工具提示。我需要描述来自数据库。描述很长,但我得到一个System.IndexOutOfRangeException
。有谁知道如何解决这一问题?请帮忙!System.IndexOutOfRangeException
int i = 0;
foreach (ListItem l in this.agile_factors.Items) {
while (dr.Read())
{
string description = dr["Description"].ToString();
l.Attributes["title"] = description;
}
i++;
}
conn.Close();
你会得到什么样的例外? – Jeff 2011-02-24 22:19:06
你在哪里得到例外。我有这种感觉,我们错过了一些重要的代码... – rene 2011-02-24 22:20:03
同上2条评论。你是否也知道我会永远等于agile_factors.Items.Size。 – 2011-02-24 22:21:56