title: declaring gridview selectcommand
body: <p>When the page loads, the GridView (located in an update panel) should be loaded with my first SQL <code>SELECT</code> statement. </p>
  
  <p>On the button click, the same GridView will be loaded with new data. </p>
  
  <p>What am i doing wrong? On startup, the GridView doesn't appear.   </p>
  
  <pre><code>Public cmd As New SqlCommand()
      Public percentp As New SqlCommand()
      Public da As New SqlDataAdapter(cmd)
      Public conn As New SqlConnection("Data Source=TEST-TEST-TEST01;Initial Catalog=TEST;Integrated Security=True")
  
  Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
      cmd.Connection = conn
      conn.Open()
      Dim ds As New DataSet
      cmd.CommandText = "Select * from test1"
      da.Fill(ds)
      GridView1.DataSource = ds.Tables(0)
      da.FillSchema(ds, SchemaType.Mapped)
      conn.Close()        
  End Sub   
  
  Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
      cmd.Connection = conn
      conn.Open()
      Dim ds As New DataSet
      cmd.CommandText = "SELECT * from test"
      da.Fill(ds)
      GridView1.DataSource = ds.Tables(0)
      da.FillSchema(ds, SchemaType.Mapped)
      conn.Close()        
      TextBox1.Text="aaaaaaaaaaa"
  End Sub
  End Class
  </code></pre>
  
  <p>I tried
     GridView1.DataSource = ds.Tables(0)
     GridView1.DataBind</p>