title: gridview paging using dataset
body: <p>I have an ASP.NET web app (C#) where I get some information from a datasource and display it in the the gridview. I wanted to enable paging, but for some reason, paging doesn't work. I researched a little online, and I found that paging is done differently if a dataset is used. When I click on a page number, it refreshes, and says that there are no records to display. I call this function in the click function of a button:</p>
  
  <pre><code>        bindGrid(cmd);
  </code></pre>
  
  <p>Here's my bind method:</p>
  
  <pre><code>    private void bindGrid(OracleCommand comm)
      {
          OracleDataAdapter adapter = new OracleDataAdapter(comm);
          DataSet ds = new DataSet();
  
          ds.Tables.Add("Results");
          adapter.Fill(ds.Tables["Results"]);
  
          grd.DataSource = ds;
          grd.DataBind();
      }
  </code></pre>
  
  <p>Paging Method:</p>
  
  <pre><code>    protected void grdResults_PageIndexChanging(object sender, GridViewPageEventArgs e)
      {
          grd.PageIndex = e.NewPageIndex;
          grd.DataBind();
      }
  </code></pre>
  
  <p>How am I supposed to do paging with a dataset? Can someone help please?</p>