DataTable.CreateDataReader Method ()
.NET Framework (current version)
![]() |
---|
The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience. |
Returns a DataTableReader corresponding to the data within this DataTable.
Assembly: System.Data (in System.Data.dll)
Return Value
Type: System.Data.DataTableReaderA 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 DataTableto a procedure that calls the CreateDataReader method, which iterates through the results contained within the DataTableReader.
The example displays the following output in the console window:
1 Mary
2 Andy
3 Peter
4 Russ
.NET Framework
Available since 2.0
Available since 2.0
Show: