Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

ADO.

NET Object Model:

 All ADO.NET related functionality appears under the System.Data namespace.


 Data Access in ADO.NET relies on two components :
1. .NET Data Providers.
2. DataSet

NET Data Providers:

 A .NET Data Provider is responsible for providing and maintaining the connection to the
database.

Following are the various .NET Data Providers:

1. SQL Server.
2. Oracle.
3. OLE DB.
4. ODBC.
5. The .NET Framework Data Provider for SQL Server uses its own protocol to
communicate with SQL server. The classes for this provider are located in
System.Data.SqlClient namespace.
6. Each Data Provider provides the following core objects:

A. Connection
B. Command
C. Data Reader
D. Data Adapter
A. Connection:

o establish a connection with the data source.


o connection objects automatically pool physical databases
o Examples of connection objects are OleDbConnection, SqlConnection,
OracleConnection and so on.

B. Command:

o represents an executable command on the underlying data source.


o may or may not return any results.
o can be used to manipulate existing data.
o Examples of command objects are SqlCommand, OracleCommand and so on. A
Command needs to be able to accept parameters.

C. Data Reader:

o designed to help you retrieve and examine the rows returned by the query as
quickly as possible.
o examines the results of a query one row at a time. When you move forward to the
next row, the contents of the previous row are discarded.
o The DataReader doesn’t support updating.
o read-only. Because supports such a minimal set of features, it is extremely fast
and lightweight.
o disadvantage it requires an open database connection and increases network
activity.

D. DataAdapter:

o acts a gateway between the disconnected and connected flavours of ADO.NET.


disconnected architecture data retrieved from database can be accessed by holding
it in a memory with the help of DataSet object even when the connection is
closed.
o Examples of DataAdapters are SqlDataAdapter, OracleDataAdapter and so on.

DataSet :

 It is an in-memory cache of data retrieved from the data source. Data is organized into
multiple tables using DataTable objects, tables can be related using DataRelation objects
and data integrity can be enforced using the constraint objects like UnqueConstraint and
ForeignKeyConstraint.
 DataSet are also fully XML-featured. They contain methods such as GetXML and
WriteXML that respectively produce and comsume XML data easily.

DataTable DataColumn DataRow DataView DataRelation

You might also like