Architecture of connected environment of data access in ADO.Net?
The connected environment of data access is the common procedure for accessing data programmatically. The differentiating property of the connected data access environment is that here you (the programmer) is required to manage the connection with the database. You can only perform database operations when, there exists an open connection to the database. Hence, before performing any database operation (select, update, insert, delete). The important objects for working in the connected environment are:
- Connection (SqlConnection, OleDbConnection, etc): It represents a connection to the database. All the connection objects in the ADO.Net implement the System.Data.IDbConnection interface.
- Command (SqlCommand, OleDbCommand, etc): It represents the SQL command sent to the database, e.g., SELECT, UPDATE, INSERT, DELETE. All commands in ADO.Net implements IDbCommand interface.
- DataReader (SqlDataReader, OleDbDataReader, etc): It represents a data stream .
What is function of data adapter?
A data adapter is integral to the working of ADO.NET since data is transferred to and from a database through a data adapter. A data adapter creates a dataset and updates the database. When you make any changes to the dataset, the modifications to the database are actually performed by the data adapter.