分页事件没有绑定的时候,搜索功能很正常 
这是搜索功能代码 
private   void   Button1_Click(object   sender,   System.EventArgs   e) 

string   str1=TextBox1.Text; 
string   sql1="select   *   from   shipin     where   (title   like   '%"+str1+"%')"; 
DataSet   ds=Db.selectDS(sql1); 
DataGrid1.DataSource=ds; 
DataGrid1.DataBind(); 

但是加了一个分页事件绑定之后,第一页还很正常,就是跳到第二页的时候出现 
无效的   CurrentPageIndex   值。它必须大于等于   0   且小于   PageCount。   
说明:   执行当前   Web   请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。   异常详细信息:   System.Web.HttpException:   无效的   CurrentPageIndex   值。它必须大于等于   0   且小于   PageCount。 源错误:   
行   109: DataSet   ds=Db.selectDS(sql1); 
行   110: DataGrid1.DataSource=ds; 
行   111: DataGrid1.DataBind(); 
行   112: 
行   113: 
那位高手提示一下,谢谢了