|
-
Jul 29th, 2007, 08:45 AM
#1
Thread Starter
New Member
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? Hope you get what I mean
-
Jul 29th, 2007, 10:10 PM
#2
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|