Connected Vs Disconnected
Connected Vs Disconnected
Connected Vs Disconnected
To cope up with some of the problems mentioned above, ADO .NET came into
existence. ADO .NET addresses the above mentioned problems by maintaining a
disconnected database access model which means, when an application
interacts with the database, the connection is opened to serve the request of the
application and is closed as soon as the request is completed. Likewise, if a
database is Updated, the connection is opened long enough to complete the
Update operation and is closed. By keeping connections open for only a
minimum period of time, ADO .NET conserves system resources and provides
maximum security for databases and also has less impact on system
performance. Also, ADO .NET when interacting with the database uses XML and
converts all the data into XML format for database related operations making
them more efficient.
Data Access in ADO.NET relies on two components: DataSet and Data Provider.
DataSet
Data Provider
The Data Provider is responsible for providing and maintaining the connection to
the database. A DataProvider is a set of related components that work together
to provide data in an efficient and performance driven manner. The .NET
Framework currently comes with two DataProviders: the SQL Data Provider
which is designed only to work with Microsoft's SQL Server 7.0 or later and the
OleDb DataProvider which allows us to connect to other types of databases like
Access and Oracle. Each DataProvider consists of the following component
classes:
A connection object establishes the connection for the application with the
database. The command object provides direct execution of the command to the
database. If the command returns more than a single value, the command object
returns a DataReader to provide the data. Alternatively, the DataAdapter can be
used to fill the Dataset object. The database can be updated using the command
object or the DataAdapter.