Return a Forward-Only Data Stream in ADO.NET

Category:
C#, VB.NET, ASP.NET
Type:
Snippets
Difficulty:
Beginning
Author:
Intelligent Solutions Inc.

Version Compatibility: Visual Basic.NET

More information:
This snippet illustrates use of ADO.NET's ADOConnection, ADOCommand, and ADODataReaders objects. The ADOConnection and ADOCommand objects are similar to the Connection and Command objects in ADO; the ADODataReader provides a way of reading a forward-only stream of data and is therefore similar to a forward-only recordset in ADO.

This snippet is similar in functionality to the one at http://www.freevbcode.com/ShowCode.Asp?ID=1257, which shows how to open a DSN-Less connection in ADO.

Originally developed for beta versions;verified to work in .NET version 1.0, 04/02/02.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: