title: Gridview not sorting and paging for excel sheet in asp
body: <p>I have a gridview and it is taking the data from an excel sheet. In visual studio, from the properties menu of the gridview I have just set paging and sorting enabled. But this is not working. Is it about the excel source or should I add some extra code ?</p>
  
  <pre><code> string whereClause = SearchTextBox.Text;
          String name = "Sheet0";
          String constr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" +
                          "C:\\Users\\BerkayS\\Desktop\\VSCLOGN.xls" +
                          ";Extended Properties='Excel 12.0 XML;HDR=YES;';";
  
  
  
  
  
          OleDbConnection con = new OleDbConnection(constr);
          OleDbCommand oconn = new OleDbCommand("Select " + selectedCriteria + " From [" + name + "$] where USER_ID = '" + whereClause + "'", con);
          con.Open();
  
          OleDbDataAdapter sda = new OleDbDataAdapter(oconn);
          DataTable data = new DataTable();
          sda.Fill(data);
          GridView2.DataSource = data;
          GridView2.DataBind();
  
  
          GridView2.Visible = true;
  </code></pre>
  
  <p>Note: Ignore some variable names in the code, they are assigned before</p>