Pages

Combo Box and List Box Data Binding in Visual Basic 2008

                                                                                 Combo box and List box Data Binding in Visual Basic 2008

The tabbed pages of the tab control demonstrate different techniques:
Add Items The sample retrieves an array of Process objects representing the processes currently running on the computer. The Process objects are added to the Items collection of the ListBox controls. The DisplayMember property of the ListBox control is used to specify which property of the Process object is displayed in the ListBox control.
Bind to DataTable This tab page has code to fill a DataTable with a list of all files in your My Documents folder, and then binds the list box to that DataTable.



Bind to Array This tab page has code similar to the Add Items page. Instead of adding the Process objects one by one to the Items collection, the whole array of Process objects is used as the DataSource of the ListBox control. The ValueMember and DisplayMember properties of the ListBox control are used to control the display and retrieval of the items.
ComboBox This tab page has code to bind a ComboBox control to a DataTable retrieved from SQL Server using the new TableAdapter and typed dataset features. This example expects that it can find the Northwind sample database in SQL Server on the local computer. The page has controls to enable you to specify some of the layout properties that affect the behavior of the ComboBox control.

 Download Project
Download Sample Project
Password to extract: combobox1001
DOWNLOAD NOW

0 comments:

Post a Comment