3.5. Retrieving a Result Set Using a DataTable or a DataSet

Problem

You want to fill a DataTable or DataSet with a result set.

Solution

Use the Fill() method of the DataAdapter object to load the result set into a DataTable or into a DataSet.

The solution fills both a DataTable and a DataSet with data from the Person.Contact table in AdventureWorks. Results are output to the...