How to ADO.NET OleDbDataReader
OleDbDataReader Object provides a connection oriented data access to the OLEDB Data Sources. ExecuteReader() in the OleDbCommand Object send the SQL statements to OleDbConnection Object and populate an OleDbDataReader Object based on the SQL statement.
When the ExecuteReader method in OleDbCommand Object execute , it instantiate an OleDb.OleDbDataReader Object. When started to read from an OleDbDataReader it should always be open and positioned prior to the first record. The Read() method in the OleDbDataReader is used to read the rows from OleDbDataReader and it always moves forward to a new valid row, if any row exist .
connetionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Your mdb filename;"
sql = "Your SQL Statement Here like Select * from product"
You have to replace the string with your realtime variables.
- ADO.NET Connection Object
- ADO.NET SQL Server Connection
- ADO.NET OLEDB Connection
- ADO.NET ODBC Connection
- ADO.NET Command
- ADO.NET ExecuteNonQuery in SqlCommand Object
- ADO.NET ExecuteNonQuery in OleDbCommand Object
- ADO.NET ExecuteScalar in SqlCommand Object
- ADO.NET ExecuteScalar in OleDbCommand Object
- ADO.NET ExecuteReader in SqlCommand Object
- ADO.NET ExecuteReader in OleDbCommand Object
- How to ADO.NET DataReader
- How to ADO.NET SqlDataReader
- How to Multiple Result Sets in ADO.NET
- Getting Schema Informations from SqlDataReader
- Getting Schema Informations from OleDbDataReader
- What is DataAdapter
- What is SqlDataAdapter
- What is OleDbDataAdapter
- Vb.NET ExecuteReader and ExecuteNonQuery