title: Display a data table in WinForms
body: <p>I'm creating a Windows form that displays a data table. I would also like to be able to select a row from the displayed table and have the information displayed on the form that called it. I've connected to the server but can't seem to populate the data table.</p>
  
  <pre><code>Dim Students As String = "select * from dbo.[students]"
  Dim Studentscmd As New SqlCommand(Students, cnn)
  Dim Studentstable As New DataTable
  Dim Studentadapter As New SqlDataAdapter
  
  Dim NStudents As DataSet = New DataSet()
  Studentadapter.Fill(NStudents)
  
  Datagridview.DataGridView1.DataSource = NStudents
  Datagridview.DataGridView1.Show()
  </code></pre>