add this line
viewState("data") = ds.Tables(0);
before
GridView1.DataSource = ds.Tables(0)
and modify as below
Private Sub GridView1_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles GridView1.PageIndexChanging
GridView1.DataSource = viewState("data")
GridView1.PageIndex = e.NewPageIndex
GridView1.DataBind()
End Sub