title: vb.net getting dataset into datagrid
body: <p>With the code below is there anyway I could get the data from the dataset into a datgrid instead of setting up all those text boxes.Any help appreciated.</p>
  
  <pre><code>  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
      Dim con As New OleDb.OleDbConnection
      Dim dbProvider As String
      Dim dbSource As String
      Dim ds As New DataSet
  
      Dim da As New OleDb.OleDbDataAdapter
      Dim sql As String
  
  
  
      dbProvider = "PROVIDER=Microsoft.ACE.OLEDB.12.0;"
      dbSource = "Data Source = C:\databases\AddressBook.mdb"
      con.ConnectionString = dbProvider &amp; dbSource
      con.Open()
      MsgBox("OPEN FOR THE DAY")
      sql = "SELECT * FROM tblContacts"
  
      da = New OleDb.OleDbDataAdapter(sql, con)
      da.Fill(ds, "owltime")
  
      txtFirstName.Text = ds.Tables("owltime").Rows(0).Item(1)
      txtSurname.Text = ds.Tables("owltime").Rows(0).Item(2)
      address1.Text = ds.Tables("owltime").Rows(0).Item(3)
      address2.Text = ds.Tables("owltime").Rows(0).Item(4)
      address3.Text = ds.Tables("owltime").Rows(0).Item(5)
      postcode.Text = ds.Tables("owltime").Rows(0).Item(6)
      phone.Text = ds.Tables("owltime").Rows(0).Item(7)
  
  
      MsgBox(" CLOSED FOR THE DAY")
  
  
      con.Close()
  
  End Sub
  </code></pre>
  
  <p>End Class</p>