October 2003
Intermediate to advanced
736 pages
15h 25m
English
In WinForms development, there often comes a time when you need to populate a number of controls with data from a database or other data source. Recall our example from Chapter 12: Data Sets and Designer Support, which used a data set populated from a database. Whenever the data set was changed, such as when the user added a row or deleted a row, we had to repopulate the list boxes so that the display was kept in sync with the data:
Sub addRowMenuItem_Click(sender As Object, e As EventArgs)
' Add a new typed row
Dim row As CustomerSet.CustomersRow = _
Me.customerSet1.Customers.NewCustomersRow()
row.CustomerID = "SELLSB"
...
Me.customerSet1.Customers.AddCustomersRow(row)
' Update list box
PopulateListBox()
End Sub
Writing code to ...