Multi-Table DataSets and Relations

Up until now, the examples have demonstrated DataSets using a single table. DataSets also support multiple tables. Therefore, you are able to fill a DataSet object with rows from multiple tables in the database.

Essentially, a DataAdapter is responsible for populating a DataSet from a specific table in the database. If you create a DataSet for each table that you want to populate a DataSet with, you can then use each DataAdapter object to populate the DataSet object. This results in populating a DataSet with many types of records. The number of different types of records depends on the number of adapters you use to populate a DataSet.

Remember in our earlier examples where we used the Tables property on a DataSet? ...

Get Visual Basic® .NET by Example now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.