title: How clear GridView in asp.net?
body: <p>I doing a web page in asp.net and in a module have select a Excel archive with <code>FileUpLoad</code> and click in a button import. Hitherto I'm fine. But in the moment than I want select other Excel archive and click in the button import, don't clear the <code>GridView</code> and show error. I attempt with this because I see in other questions similar to this.</p>
  
  <p>With this I load the Grid</p>
  
  <pre><code>Conn = string.Format(Conn, DireccionArchivo, MostrarHDR);
  OleDbConnection ConnExcel = new OleDbConnection(Conn);
  OleDbCommand CmdExcel = new OleDbCommand();
  OleDbDataAdapter Oda = new OleDbDataAdapter();
  DataTable Dt = new DataTable();
  CmdExcel.Connection = ConnExcel;
  
  ConnExcel.Open();
  CmdExcel.CommandText = "SELECT * From ["Page1$"]";
  Oda.SelectCommand = CmdExcel;
  Oda.Fill(Dt);
  ConnExcel.Close();
  
  grdResultados.Caption =  Path.GetFileName(DireccionArchivo);
  grdResultados.DataSource = Dt;
  grdResultados.DataBind();
  </code></pre>
  
  <p>And with this I want to clear the <code>GridView</code> and last y called of new the method of load the <code>GridView</code></p>
  
  <pre><code>DataTable ds = new DataTable();
  ds = null;
  grdResultados.DataSource = ds;
  grdResultados.DataBind();
  </code></pre>
  
  <p>The error than show me is in the <code>grdResultados.DataBind();</code> when called the second time.</p>