Table of Contents Previous Next


4 Using the .NET Connector : 4.2 Retrieving Database Records

You can use a SELECT statement to retrieve records from the database via a SELECT command. To execute a SELECT statement you must:
Create an EDBCommand object that represents the SELECT statement.
Execute the command with the ExecuteReader() method of the EDBCommand object returning a EDBDataReader
Loop through the EDBDataReader displaying the results or binding the EDBDataReader to some control.
An EDBDataReader object represents a forward-only and read-only stream of database records, presented one record at a time. To view a subsequent record in the stream, you must call the Read() method of the EDBDataReader object.
1.
2.
Initializes an EDBCommand object with a SELECT statement.
4.
Executes the EDBCommand by calling the ExecuteReader method of the EDBCommand object.
5.
Loops through the contents of the EDBDataReader object to display the records returned by the query within a WHILE loop.
The Read() method advances to the next record (if a record exists) and returns true if a record exists, or false to indicate that the EDBDataReader has reached the end of the result set.
http://localhost/selectEmployees.aspx.

4 Using the .NET Connector : 4.2 Retrieving Database Records

Table of Contents Previous Next