Part - 1 Introduction To
Part - 1 Introduction To
Part - 1 Introduction To
ADO stands for Microsoft ActiveX Data Objects. ADO.NET is one of Microsoft’s Data
Access Technologies using which we can communicate with different data sources. It is
a part of the .NET Framework which is used to establish a connection between the .NET
Application and data sources. The Data Sources can be SQL Server, Oracle, MySQL,
and XML, MSAccess, MSExcel, etc. ADO.NET consists of a set of classes that can be
used to connect, retrieve, insert, update and delete data (i.e. performing CRUD
operation) from data sources. ADO.NET mainly
uses System.Data.dll and System.Xml.dll.
Components of ADO.NET
Connection, Command, DataReader, DataAdapter, DataSet, and DataView are the
components of ADO.NET that are used to perform database operations. ADO.NET has two
main components that are used for accessing and manipulating data. They are as follows:
1. Data Provider (Connected Oriented Architecture)
2. DataSet (Dis-Connected Oriented Architecture)
All these classes are present in System.Data.SqlClient namespace. We can also say that
the .NET data provider for the SQL Server database is System.Data.SqlClient.
The point that you need to remember is depending on the provider, the ADO.NET objects
(Connection, Command, DataReader, and DataAdapter) have a different prefix as
shown below.
1. Connection – SQLConnection, OracleConnection, OleDbConnection,
OdbcConnection, etc.
2. Command – SQLCommand, OracleCommand, OleDbCommand, OdbcCommand,
etc.
3. DataReader – SQLDataReader, OracleDataReader, OleDbDataReader,
OdbcDataReader, etc.
4. DataAdapter – SQLDataAdapter, OracleDataAdapter, OleDbDataAdapter,
OdbcDataAdapter, etc.
DataSet:
The DataSet object in ADO.NET is not Provider-Specific. Once you connect to a database,
execute the command, and retrieve the data into the .NET application. The data can then
be stored in a DataSet and work independently of the database. So, it is used to access
data independently from any data source. The DataSet contains a collection of one or more
DataTable objects.