title: How to display data on Gridview in ASP.NET 4.0 when we click button?
body: <pre><code>Imports System.Data.Odbc
  Imports System.Data
  Partial Class VIEW_SALARY_DETAILS
       Inherits System.Web.UI.Page
  
     Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
      Dim cons, query As String
      Dim con As OdbcConnection
      Dim adpt As OdbcDataAdapter
      cons = "dsn=Courier; UID=Courier; PWD=123;"
      con = New OdbcConnection(cons)
      con.Open()
      query = "select * from EMPLOYEE"
      Dim ds As DataSet
      adpt = New OdbcDataAdapter(query, con)
      ds = New DataSet
      adpt.Fill(ds, "Courier")
      GridView1.DataSource = ds.Tables()
      con.Close()
     End Sub
  End Class
  </code></pre>
  
  <p>I wrote the above code but it does not display data.
  Same thing is possible in VB.NET application.
  How do we do it for ASP.net 4.0?</p>