The DataReader is very easy to use. To get an instance of the DataReader object, you call the ExecuteReader() of the Command object, rather than using the DataAdapter. The ExecuteReader() returns a new instance of a DataReader object ready to display data starting at the first record returned. The code in Listing 8.2 (VB .NET) and in Listing 8.3 (C#) shows how to get a DataReader object.
Dim conn as New SqlConnection("Initial Catalog=Northwind;" + _ "Server=(local);UID=sa;PWD=;") Dim cmd as New SqlCommand("SELECT * FROM Employees", conn) Dim reader as SqlDataReader conn.Open() reader = cmd.ExecuteReader()