O'Reilly logo

Visual Basic® .NET Database Programming by Rod Stephens

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

Selecting a Calculated Field

The ContactsList program is a big improvement over program Contacts but record selection is still a little awkward. The program lets the user pick a record from a list of LastName field values. It would be better if the list included the FirstName field as well. Then if the database had many records with a LastName value of Stephens, you could decide exactly which of the records to select.

You cannot bind the ListBox’s DisplayMember property to more than one data source field, but you can add a calculated field that combines the LastName and FirstName fields to the data source. First, modify the data adapter so it selects the calculated field. Click on the daContacts object and click the Configure Data Adapter link ...

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