Implementing a Custom DataReader

As you know, a DataReader is a class that provides a fast, forward-only method for traversing data returned from a command execution. In the case of SQL Server, this reader is live and connected to the server. In most cases, a DataReader is faster than filling a DataSet because it is a forward-only cursor.

The sample case simulates external data from the web service. That data is actually simulated using a DataTable. For that reason, the RDPDataReader isn't any faster than a DataSet. As mentioned earlier, this is only a sample implementation. In the real world, you would have some kind of proprietary data format for interfacing with the web service. In addition, you might be able to limit the number of rows returned ...

Get Microsoft® Visual C#® .NET 2003 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.