我察看了CurrentPageIndex,明明是1啊!

解决方案 »

  1.   

    delit(id);
    try
    {
    dbBind();   //绑定数据库
    }
    catch
    {
    //处理删除最后一页最后一条数据的时候
    if(dgNewsType.CurrentPageIndex>=dgNewsType.PageCount)
    {
    int i=dgNewsType.CurrentPageIndex;
    i--;
    dgNewsType.CurrentPageIndex=i;
    dgNewsType.DataBind();  
    }
    }
      

  2.   

    DComm.Parameters("@Sno").Value = StuData.DataKeys(CInt(e.Item.ItemIndex))
    改为
    DComm.Parameters("@Sno").Value = StuData.DataKeys(CInt(e.Item.DataSetIndex))
      

  3.   

    to dragontt(龙人)
    改了以后:
    索引超出范围。必须为非负值并小于集合大小。参数名:index
      

  4.   

    to cmsoft(韦小宝是我的老乡.net)
    那段代码应该加在绑定函数里吗?