0% found this document useful (0 votes)
223 views10 pages

Topic: ADO. Net Framework

ADO.NET is a framework in .NET used to access and update data. It provides a bridge between front-end controls and back-end databases. Applications use ADO.NET to retrieve stored data from a database and present it to users, as well as to update the database by inserting, modifying, and deleting data. Important ADO.NET classes include the Connection class to connect to databases, the Command class to execute queries and commands, the DataAdapter class to transfer data between databases and datasets, and the DataSet class to store data in memory.

Uploaded by

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

Topic: ADO. Net Framework

ADO.NET is a framework in .NET used to access and update data. It provides a bridge between front-end controls and back-end databases. Applications use ADO.NET to retrieve stored data from a database and present it to users, as well as to update the database by inserting, modifying, and deleting data. Important ADO.NET classes include the Connection class to connect to databases, the Command class to execute queries and commands, the DataAdapter class to transfer data between databases and datasets, and the DataSet class to store data in memory.

Uploaded by

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

Topic: ADO.

Net
Framework
ADO. Net-Overview
Microsoft ActiveX Data Objects.Net (ADO.Net) is a model, and a part of the
.Net framework that is used by the .Net applications for retrieving, accessing
and updating data.
ADO.NET provides a bridge between the front end controls and the back
end database.
Applications communicate with a database,
Firstly, to retrieve the data stored there and present it in a user-friendly way
Secondly, to update the database by inserting, modifying and deleting data.
ADO. Net
The following are a few of the .NET applications that use ADO.NET to
connect to a database, execute commands and retrieve data from the
database.
ASP.NET Web Applications
Console Applications
Windows Applications.
ADO. Net Architecture
ADO.NET Classes
Various important classes in the preceding diagram are:
Connection Class
Command Class
DataReader Class
DataAdaptor Class
DataSet.Class
ADO. Net Connection Class
1. Connection Class
In ADO.NET, we use these connection classes to connect to the database.

Syntax:
String constr="server=SYSTEM-NAME; initial catalog=DATABASE-NAME; integrated
security=true”;
SqlConnection conn=new sqlconnection(constr);
ADO. Net Command Class
2. Command Class
  The Command class provides methods for storing and executing SQL statements.
 The following are the various commands that are executed by the Command Class.
 ExecuteReader: Returns data to the client as rows.
 Mostly used directly for printing reports and so forth.
 ExecuteNonQuery: Executes a command that changes the data in the database, such as an
update, delete, or insert .
 This method returns an integer that is the number of rows affected by the query.
 ExecuteScalar: This method only returns a single value.
 This kind of query returns a count of rows or a calculated value.

String com=“Select * from tblStd”;


Sqlcommand comm=new sqlcommand(com,conn);
comm.executenonquery();
ADO. Net DataAdapter Class
3. Data Adapter
The DataAdapter is used to connect DataSets to databases.
Data is transferred to and from a database through a data adapter.
It retrieves data from a database into a dataset and updates the database.
When changes are made to the dataset, the changes in the database are actually
done by the data adapter.

Sqldataadapter da=new sqldataadapter(comm);


ADO. Net DataSet Class
4. DataSet
DataSet is an in-memory representation of data.
When a connection is established with the database, the data adapter creates a
dataset and stores data in it.

 Syntax:
Dataset ds=new dataset(da);
da.fill(ds);
Any Question..?

You might also like