Databinding and textboxes
Hi guys,
I've been searching around for information on how to make textboxes display the data on my sql database. For example, when I click on a field in the datagridview, it will display all the information in that row in different textboxes.
How can I do that? Are there any tutorials on SELECT WHERE statements? :confused: Hope you get what I mean
Re: Databinding and textboxes
http://www.vbforums.com/showthread.php?t=469872
Retrieve your data into a DataTable, then bind that DataTable to a BindingSource:
vb.net Code:
myBindingSource.DataSource = myDataTable
Bind the BindingSource to both the grid and the TextBox:
vb.net Code:
myDataGridView.DataSource = myBindingSource
myTextBox.DataBindings.Add("Text", myBindingSource, "ColumnNameHere")
That's it. The rest is taken care of for you.