我先把数据查出来显示在DataGrid1中,当改变了它的索引后,再改变查询条件查询时,却出现了下面的错误,这是为什么呀?望高手帮帮忙!
  “/sincoweb/EmployeeInfo”应用程序中的服务器错误。
--------------------------------------------------------------------------------无效的 CurrentPageIndex 值。它必须大于等于 0 且小于 PageCount。 
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.Web.HttpException: 无效的 CurrentPageIndex 值。它必须大于等于 0 且小于 PageCount。源错误: 
行 251: DataGrid1.DataSource=ds.Tables["员工"];
行 252: this.DataGrid1.DataKeyField = "序号";//删除时要用
行 253: DataGrid1.DataBind();
行 254: if(DataGrid1.Visible==false)
行 255: DataGrid1.Visible=true;
 源文件: d:\inetpub\wwwroots\sincoweb\employeeinfo\querywebform4.aspx.cs    行: 253 堆栈跟踪: 
[HttpException (0x80004005): 无效的 CurrentPageIndex 值。它必须大于等于 0 且小于 PageCount。]
   System.Web.UI.WebControls.DataGrid.CreateControlHierarchy(Boolean useDataSource) +2117
   System.Web.UI.WebControls.BaseDataList.OnDataBinding(EventArgs e) +49
   System.Web.UI.WebControls.BaseDataList.DataBind() +23
   EmployeeInfo.queryWebForm4.Button3_Click(Object sender, EventArgs e) in d:\inetpub\wwwroots\sincoweb\employeeinfo\querywebform4.aspx.cs:253
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain() +1277 
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:1.1.4322.573; ASP.NET 版本:1.1.4322.573