0% found this document useful (0 votes)
14 views

New Information Technology 10 ADO.net

ADO.NET is a Microsoft database access technology within the .NET framework that allows interaction with various data sources using SQL queries and stored procedures. Its architecture consists of Data Providers and DataSets, with key components including Connection, Command, DataReader, and DataAdapter objects. ADO.NET supports operations like insert, update, delete, and select, and features a disconnected data architecture for improved performance.

Uploaded by

az711az619az
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

New Information Technology 10 ADO.net

ADO.NET is a Microsoft database access technology within the .NET framework that allows interaction with various data sources using SQL queries and stored procedures. Its architecture consists of Data Providers and DataSets, with key components including Connection, Command, DataReader, and DataAdapter objects. ADO.NET supports operations like insert, update, delete, and select, and features a disconnected data architecture for improved performance.

Uploaded by

az711az619az
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

ADO.

Net

ADO.NET stands for ActiveX Data Object is a database access


technology created by Microsoft as part of its .NET framework that can
access any kind of data source. ADO .NET uses SQL queries and stored
procedures to read write update and delete data from a data source. You
use SQL queries through ADO.NET Command object, which returns data
in the form of DataReader or DataSet objects.

➢ ADO.NET Architecture

ADO.NET Architecture has two components:

ADO.Net (DataSet) and Data Provider

ADO.NET consist of a set of Objects that description data access services


to the .NET environment. It is a data access technology from Microsoft
.Net Framework, which provides communication between relational and
non-relational systems through a common set of components.

1
✓ Data Provider and DataSet
The two key components of ADO.NET are Data Providers and DataSet .
• Data Provider classes are designed to work with different kinds of
data sources. They are used to perform all data-management
operations on specific databases.

✓ The .Net Framework includes mainly three Data Providers for


ADO.NET.
- SQL Server Data Provider (ASP.NET SQL Server Connection) uses the
SqlConnection object String connectionString =
ConfigurationManager.ConnectionStrings["SQLDbConnection"].ToStri
ng();
connectionString: A connection string provides the information that a
provider needs to communicate with a particular database that’s include
parameters such as the name of the driver, Server name and Database
name, as well as security information such as user name and password.

2
- OLEDB Data Provider (ASP.NET OLEDB Connection) uses the
OleDbConnection Object
- ODBC Data Provider (ASP.NET ODBC Connection) uses
OdbcConnection Object respectively.

✓ Data Provider contains four objects for provides the


functionality of Data Providers in the ADO.NET. Connection,
Command, DataAdapter, and DataReader objects.

• Connection
The Connection Object provides physical connection to the Data Source.
Connection object needs the necessary information to recognize the data
source.

• Command

3
The Command Object uses to perform SQL statement or stored procedure
to be executed at the Data Source. The command object provides a
number of Execute methods that can be used to perform the SQL queries
in a variety of fashions.

✓ There are three methods uses in the Command Object to


execute the SQL statements.

- The ExecuteNonQuery(): The Data Definition tasks like


creating Stored Procedures , like Insert , Update , Delete etc.
also perform by the ExecuteNonQuery() of SqlCommand
Object. C#: command.ExecuteNonQuery();.

- The ExecuteReader() in SqlCommand Object sends the SQL


statements to the Connection Object and populate a
SqlDataReader Object based on the SQL statement.
C#: SqlDataReader reader = cmd.ExecuteReader();
- The ExecuteScalar method uses to retrieve a single value from
a database and returns the first column of the first row in the
result set, or a null reference if the result set is empty. C#: int
result = Convert.ToInt32(cmd.ExecuteScalar());

4
• DataReader

The DataReader Object is a stream-based, forward-only, read-only


retrieval of query results from the Data Source, which do not update the
data. DataReader requires a live connection with the databse and provides
a very intelligent way of consuming all or part of the result set.

• DataAdapter

DataAdapter Object populate a Dataset Object with results from a Data


Source. It is a special class whose purpose is to bridge the gap between
the disconnected Dataset objects and the physical data source.

✓ DataSet

• DataSet class provides mechanisms for managing data when it is


disconnected from the data source.

✓ The DataSet contains: rows, columns, primary keys, constraints,


and relations with other DataTable objects.

It consists of a collection of DataTable


objects that you can relate to each other
with DataRelation objects.

5
✓ The purpose of ADO Net
ADO.NET is a data access technology that provides communication
between relational and non-relational systems through a common set of
components. ADO.NET is a set of computer software components that
programmers can use to access data and data services from a database.

✓ The features of ADO.Net

• It provides some in built classes to connect databases like mysql,


sql, oracle etc,.
• In built classes to do operations like insert, update, delete and
select.
• Integration with XML.
• Disconnected Data architecture for better performance.

You might also like