DataSet::CreateDataReader Method
Returns a DataTableReader with one result set per DataTable, in the same sequence as the tables appear in the Tables collection.
Assembly: System.Data (in System.Data.dll)
| Name | Description | |
|---|---|---|
![]() | CreateDataReader() | Returns a DataTableReader with one result set per DataTable, in the same sequence as the tables appear in the Tables collection. |
![]() | CreateDataReader(array<DataTable^>^) | Returns a DataTableReader with one result set per DataTable. |
In order to ensure the order of the result sets within the returned DataTableReader, if a DataTable within the DataSet is empty, it will be represented by an empty result set within the returned DataTableReader.
This example, a Console application, creates three DataTable instances and adds each to a DataSet. The example calls the CreateDataReader method and displays the contents of the returned DataTableReader. Note that the order of the result sets in the DataTableReader is controlled by the order of the DataTable instances passed as parameters.
Note |
|---|
This example shows how to use one of the overloaded versions of CreateDataReader. For other examples that might be available, see the individual overload topics. |
The example displays the following code in the Console window:

