程序在用到几个小时后突然出现如下错误,重启服务器后又好拉,请问何故??
Index was outside the bounds of the array.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array.Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace:
[IndexOutOfRangeException: Index was outside the bounds of the array.]
Ydyd.WebControls.RelatedList.RelatedListItemsFromDataSet.GenerateXmlData(StringBuilder xmlData, String parentValue)
Ydyd.WebControls.RelatedList.RelatedListItemsFromDataSet.GenerateXmlData(StringBuilder xmlData, String parentValue)
Ydyd.WebControls.RelatedList.RelatedListItemsFromDataSet.GenerateXmlData(StringBuilder xmlData, String parentValue)
Ydyd.WebControls.RelatedList.RelatedListItemsFromDataSet.GenerateXmlData(StringBuilder xmlData, String parentValue)
Ydyd.WebControls.RelatedList.RelatedListItemsFromDataSet.GenerateXmlData(StringBuilder xmlData, String parentValue)
Ydyd.WebControls.RelatedList.RelatedListItemsFromDataSet.GetClientXmlData(String controlID, Page page)
Ydyd.WebControls.RelatedList.RelatedList.InitItems()
Ydyd.WebControls.RelatedList.RelatedList.OnDataBinding(EventArgs e)
Ydyd.WebControls.RelatedList.RelatedList.DataBind()
WebAppPowerDataGridTest.sanjishu.BindRelatedList() in D:\sanjishu.aspx.cs:101
WebAppPowerDataGridTest.sanjishu.Page_Load(Object sender, EventArgs e) in D:\sanjishu.aspx.cs:39
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
---------------------------------------------------------------------------------
private void BindRelatedList()//装载所有列表
{
string con = data.constr,sql="";
SqlConnection connection = new SqlConnection(con);
sql="select * from category";
SqlDataAdapter da = new SqlDataAdapter(sql, connection);
DataSet ds = new DataSet();
da.Fill(ds);
ArrayList b = new ArrayList();
b.Add("DropDownList5");
b.Add("DropDownList6");
b.Add("DropDownList7");
b.Add("DropDownList4"); RelatedList2.DataSource = ds;
RelatedList2.ListID = b;
RelatedList2.DataBind();
}
Index was outside the bounds of the array.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array.Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace:
[IndexOutOfRangeException: Index was outside the bounds of the array.]
Ydyd.WebControls.RelatedList.RelatedListItemsFromDataSet.GenerateXmlData(StringBuilder xmlData, String parentValue)
Ydyd.WebControls.RelatedList.RelatedListItemsFromDataSet.GenerateXmlData(StringBuilder xmlData, String parentValue)
Ydyd.WebControls.RelatedList.RelatedListItemsFromDataSet.GenerateXmlData(StringBuilder xmlData, String parentValue)
Ydyd.WebControls.RelatedList.RelatedListItemsFromDataSet.GenerateXmlData(StringBuilder xmlData, String parentValue)
Ydyd.WebControls.RelatedList.RelatedListItemsFromDataSet.GenerateXmlData(StringBuilder xmlData, String parentValue)
Ydyd.WebControls.RelatedList.RelatedListItemsFromDataSet.GetClientXmlData(String controlID, Page page)
Ydyd.WebControls.RelatedList.RelatedList.InitItems()
Ydyd.WebControls.RelatedList.RelatedList.OnDataBinding(EventArgs e)
Ydyd.WebControls.RelatedList.RelatedList.DataBind()
WebAppPowerDataGridTest.sanjishu.BindRelatedList() in D:\sanjishu.aspx.cs:101
WebAppPowerDataGridTest.sanjishu.Page_Load(Object sender, EventArgs e) in D:\sanjishu.aspx.cs:39
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
---------------------------------------------------------------------------------
private void BindRelatedList()//装载所有列表
{
string con = data.constr,sql="";
SqlConnection connection = new SqlConnection(con);
sql="select * from category";
SqlDataAdapter da = new SqlDataAdapter(sql, connection);
DataSet ds = new DataSet();
da.Fill(ds);
ArrayList b = new ArrayList();
b.Add("DropDownList5");
b.Add("DropDownList6");
b.Add("DropDownList7");
b.Add("DropDownList4"); RelatedList2.DataSource = ds;
RelatedList2.ListID = b;
RelatedList2.DataBind();
}
解决方案 »
- 再问一个GRIDVIEW tooltip 的问题
- asp.net(c#)里定时器和弹出对话框冲突??
- 并非所有代码的路径都返回值
- 读出的数据与数据库内的不一致是怎么回事?
- 请问如何给datalist或datagrid加分隔线,
- 怎样做到不改变业务逻辑层
- 那位高手能讲解一下DotLucene
- 关也datagrid的取值问题,谢谢
- |zyciis| 还是SQL事务的问题 如果我没有Rollback就直接Dispose掉事务和连接的话 我原操作的数据将会怎么样
- 如何使.aspx文件的打开模式默认为HTML模式?
- XMLHTTP在.net中如何把一个XML文件提交到服务器
- 请帮我看看这个页面是怎么回事?
{
if (!Page.IsPostBack)
{
BindRelatedList();
}
}
{
BindRelatedList();
}
BindRelatedList();只在页面载入时执行了一遍