Q:

Textbox equal to column in a SQL Server table

When I select a row in my VB program from my SQL Server table, how can I get my textboxes to reflect the data in the row selected?

A:

If you are using the DataGridView control, start with this:
DataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect
DataGridView1.MultiSelect = False

Then handle the SelectionChanged event and put values in your textboxes:
    Private Sub DataGridView1_SelectionChanged(sender As Object, e As EventArgs) Handles DataGridView1.SelectionChanged
        TextBox1.Text = DataGridView1.SelectedRows(0).Cells("Text1").Value
        TextBox2.Text = DataGridView1.SelectedRows(0).Cells("Text2").Value
        TextBox3.Text = DataGridView1.SelectedRows(0).Cells("Text3").Value
    End Sub

