O'Reilly logo

Microsoft® .NET Compact Framework Kick Start by Ronnie Yates, Erik Rubin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Binding Data to a Control

Up to now all of the examples that have painted the contents of a DataSet have done so by iterating through the DataTables.Rows collection for each DataTable inside the DataSet. This is non-ideal for several reasons:

  • The burden of responsibility to paint the data manually every time there is an update in the DataSet contents falls on the developer.

  • The process of painting into a ListBox is error prone.

  • It is unwieldy to write code that paints only those DataRows with certain RowState values.

  • It is not easy to make the ListBox appealing to the eye when using it to display relational data.

The best solution to this problem is to use data binding, which connects a source of data to a consumer. The most popular source of data ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required