ADO.Net Data Access Model for ASP.Net-Part 1

Updated on 02 Apr 2012,
Published on 16 Apr 2008

Introduction to ADO.Net

ADO.Net Framework is the data access model for ASP.Net or .Net based applications. ADO.Net includes the features to access the database from various relational database systems such as SQL Server 2000, SQL Server 2005, and Oracle etc and provides their supported OLE DB and ODBC providers.

ADO.Net includes 2 models to access the data from various data sources:

  1. Connected Data Access Model
  2. Disconnected Data Access Model

Connected Data Access Model

ADO.Net provides the classes and data access components to work with database systems. To do some initial tasks you need to create some objects that work in the open connection state of database. These component classes are:

1. Connection

It accepts the connection string to establish the connection between the application and database system.

2. Command

It executes the supported syntax of command to perform various actions on connected database.

3. DataReader

It enables to represent the data retrieved from the data source

Above three classes provide the fundamental features and methods to work with database. They help to connect to a database, execute a command and represent the data retrieved from the database.

Class names used above do not exist they are just used to understand their role in Data Access Model. Actually these classes have their specific name according to the database provider used to access the database.

Examples

SqlConnection class, OleDbConnection class, ODBCConnection class, OracleConnection class. These different connection classes are used to connect to the different types of data sources.

ADO.Net Data Providers

ADO.Net includes two categories of data providers:

  1. Native providers
  2. Bridge Providers

Native providers such as SQL Server and Oracle that provide high performance due to one less layer between application and database communication. Bridge providers such as OLE DB and ODBC access the database through OLE DB layer or COM.

ADO.Net data providers:

  1. SQL Server .Net Data Provider: It communicates directly with SQL Server to access the database that uses native data transfer protocol of SQL Server.
  2. Oracle .Net Data Provider: It enables data access from Oracle data source through Oracle client connectivity.
  3. OLE DB .Net Data Provider: It communicates with data source through OLE DB layer while data transferring which slightly less efficient than native providers.
  4. ODBC .Net Data Provider: It used ODBC Driver Manager to communicate with data source by COM interoperability.

ADO.Net Namespaces

All classes, struct and enum etc are included in the corresponding namespaces of different Data Providers

  1. System.Data.SqlClient: For SQL Server .NET Data Provider types.
  2. System.Data.OracleClient: For Oracle .NET Data Provider
  3. System.Data.OleDb: For OLE DB .NET Data Provider types.
  4. System.Data.Odbc: For ODBC .NET Data Provider types.
  5. System.Data: For common classes such as DataSet and DataTable.

Continue to next tutorial: ADO.Net Data Access Model for ASP.Net-Part 2 to learn about the disconnected type data access model.

0 Responses to "ADO.Net Data Access Model for ASP.Net-Part 1"
Leave a Comment
* required
* required
* will not be published
* optional
* hint: http://www.example.com
  • Subscribe via Email
  • HIRE EzineASP.Net Developers