Microsoft ADO.NET (ActiveX Data Objects .NET) is part of the Microsoft .NET Framework: a set of tools and layers that allows your application to easily manage and communicate with its file-based or server-based data store.ADO.NET (ActiveX Data Objects .NET)is the primary data access API for the .NET Framework.
It provides the classes that you use as you develop database applications with Visual Basic .NET as well as other .NET languages. Ado.net consists of classes that allow a .NET application to connect to the data source, executes commands and manage disconnected data.In the .NET Framework, the ADO.NET libraries appear under the System.Data namespace.These libraries include functionality to connect to these data sources, execute commands,and store, manipulate, and retrieve data.
|Data Source Name||Provider Name|
|Oracle client software version 8.1.7||System.Data.Oracle Client|
|Entity Data Model (EDM) applications||System.Data.EntityClient|
|Microsoft SQL Server Compact 4.0||System.Data.SqlServerCe|
The two key components of ADO.NET are Data Providers and DataSet . The .Net Framework includes mainly three Data Providers for ADO.NET. They are the Microsoft SQL Server Data Provider, OLEDB Data Provider and ODBC Data Provider. SQL Server uses the SqlConnection object , OLEDB uses the OleDbConnection Object and ODBC uses OdbcConnection Object respectively.
The Data Provider is used for providing and maintaining the connection to the database. A DataProvider is a collection of related components that work together to provide data in an efficient and performance driven mannern.
The .net framwork has 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:
- The Connection object - It provides a connection to the database
- The Command object - It is used to execute a command.
- The DataReader object- It provides a forward-only, read only, connected recordset.
- The DataAdapter object- It populates a disconnected DataSet with data and performs update.
The dataset is a disconnected, in-memory representation of data. It can be defined as a local copy of the relevant portions of the database.DataSet consists of a collection of DataTable objects that you can relate to each other with DataRelation objects. The DataTable is a collection of DataRow and DataCoulumn Object which contains Data.
The DataAdapter Object create a bridge between the DataSet and the Data Source The DataSet is persisted in memory and the data in it can be manipulated and updated independent of the database. When the use of this DataSet is finished, changes can be made back to the central database for updating. The data in DataSet can be loaded from any valid data source like Microsoft sql database an oracle atabase or from a Microsoft Access database.
|ADO works with connected data||ADO.NET uses data in a disconnected fashion|
|In ADO, the in-memory representation of data is the recordset.||In ADO.NET, it is the dataset|
|In ADO you scan sequentially through the rows of the recordset using the ADO MoveNext method.||In ADO.NET, rows are represented as collections, so you can loop through a table as you would through any collection,or access particular rows via ordinal or primary key index.|
|ADO's are stateful(TCP/IP)||ADO.NET's are stateless(internet)|
|ADO objects communicate in binary mode.||ADO.NET uses XML for passing the data.|
|ADO allows you to create client-side cursors only||ADO.NET gives you the choice of either using client-side or server-side cursors.|
|Derives information about data implicitly at run time, based on metadata that is often expensive to obtain.||Leverages known metadata at design time in order to provide better run-timeperformance and more consistent run-time behavior.|
|Includes implicit behaviors that may not always be required in an application and that may therefore limit performance.||Includes implicit behaviors that may not always be required in an application and that may therefore limit performance.|
The salient features of ADO.NET
- ADO.NET Does Not Depend On Continuously Live Connections.
- Database Interactions Are Performed Using Data Commands.
- Data Can Be Cached in Datasets.
- Datasets Are Independent of Data Sources.
- Data Is Persisted as XML.
- Schemas Define Data Structure