Data binding technology is the basic and most important link to program the data of data .NET program development language. It is the basis for adding, deleting, browsing, and modifying operations in the database. Although the data binding method is different for different WinForm components, it is generally small. In the entire data binding, different components can be roughly divided into two categories, and one is simple data binding, and the other is complex data binding. The object for simple data is a TEXTBOX component, a Label component, and the like. There is only one record of the display of the assembly after the binding; the complex type target is a ListBox component, TreeView component, etc., often displayed after the binding record is comparison Many. First, TextBox's data binding textBox1.databindings.add ("Properties Name", Dataset_System.tables ("Company"), Dataset_System.tables ("Company"). Column.Item (i) .caption)
Second, the number of Listbox and ComboBox is bound to "Datasource", "Displaymember", "Valuemember". "DataSource" is the specified dataset; "Displaymember" is the field value displayed by the Combox component; "Valuemember" is the value after the Combox component is selected. Me.combobox1.datasource = dataset_system.tables ("Table Name) Me.comBobox1.displaymember =" Field Name 1 "Me.combobox1.valuememember =" Field Name 2 "
Get the corresponding value separately with Me.comBobox1.selectedText and Me.comBobox1.SelectedValue