Data Binding

In Windows Forms 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:

void addRowMenuItem_Click(object sender, EventArgs e) {
  // Add a new typed row
					CustomerSet.CustomersRow row =
  row.CustomerID = "SELLSB";

  // Update list box

Writing code to do ...

Get Windows Forms Programming in C# now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.