Simple Data Binding

Simple data bindingis binding a single element of data to a single control property such as a TextBox displaying the ProductName column from a table (in its Text property).

The following code shows how to bind the ProductName column from a DataTable to a TextBox named TextBox1.

TextBox1.DataBindings.Add("Text", productsBindingSource, "ProductName") // C#

TextBox1.DataBindings.Add("Text", productsBindingSource, "ProductName");

Was this article helpful?

0 0

Post a comment