Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

DataTable::CreateDataReader Method

Returns a DataTableReader corresponding to the data within this DataTable.

Namespace:  System.Data
Assembly:  System.Data (in System.Data.dll)
public:
DataTableReader^ CreateDataReader()

Return Value

Type: System.Data::DataTableReader
A DataTableReader containing one result set, corresponding to the source DataTable instance.

The following console application creates a DataTable instance. The example then passes the filled DataTable to a procedure that calls the CreateDataReader method, which iterates through the results contained within the DataTableReader.

No code example is currently available or this language may not be supported.

The example displays the following output in the console window:

1 Mary

2 Andy

3 Peter

4 Russ

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.