VB.NET & DataAdapter() The DataReader provides a way of reading a forward-only stream of data rows from a data source. This class cannot be inherited.
ShotDev Focus:
- VB.NET & DataReader()
Example
DataReader.aspx
<%@ Import Namespace="System.Data"%> <%@ Import Namespace="System.Data.OleDb"%> <%@ Page Language="VB" %> <script runat="server"> Dim objConn As System.Data.OleDb.OleDbConnection Dim objCmd As System.Data.OleDb.OleDbCommand Dim strConnString As String strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath("database/mydatabase.mdb")&";Jet OLEDB:Database Password=;" objConn = New System.Data.OleDb.OleDbConnection(strConnString) objConn.Open() Dim strSQL As String strSQL = "SELECT * FROM customer" Dim dtReader As System.Data.OleDb.OleDbDataReader objCmd = New System.Data.OleDb.OleDbCommand(strSQL, objConn) dtReader = objCmd.ExecuteReader() '*** DataReader ***' dtReader.Close() dtReader = Nothing objConn.Close() objConn = Nothing </script>