SlideShare ist ein Scribd-Unternehmen logo
1 von 15
Presentation
Created By :
Prabhu R
.Net
ADO.Net
Introduction to Ado.net
 Ado stand for Active Database Object.
 Before Ado.net we use Ado to access data from
database. Basically Ado has automatic driver
detection technique and its has only one drawback
that it only provide a connected environment so
efficiency of system may decrease.
 ADO.NET is a new database technology used by
.NET platform (introduced in 2002).
 In fact it is a set of classes used to communicate
between an application front end and a database.
 It supports both connected & disconnection mode of
data access.
Difference between ADO and ADO.NET
ADO ADO.NET
1.It is a COM based library. 1.It is a CLR based library.
2.Classic ADO requires active connection with the
data store.
2.ADO.NET architecture works while the data store is
disconnected.
3.Locking feature is available. 3.Locking feature is not available.
4.Data is stored in binary format. 4.Data is stored in XML.
5.XML integration is not possible. 5.XML integration is possible.
6.It uses the object named Recordset to reference
data from the data store.
6.It uses Dataset Object for data access and
representation.
7.Using Classic ADO, we can obtain information from
one table or set of tables through join. We cannot
fetch records from multiple tables independently.
7.Dataset object of ADO.NET includes collection of
DataTables wherein each DataTable will contain records
fetched from a particular table. Hence multiple table
records are maintained independently.
8.Firewall might prevent execution of Classic ADO.
8.ADO.NET has firewall proof and its execution will never
be interrupted.
9.Classic ADO architecture includes client side cursor
and server side cursor. 9.ADO.NET architecture doesn't include such cursors.
10.We cannot send multiple transactions using a
single connection instance.
10.We can send multiple transactions using a single
connection instance.
Namespaces used in ADO. Net
 System.Data
 It contains the common classes for connecting, fetching data
from database. Classes are like as DataTable, DataSet,
DataView etc.
 System.Data.SqlClient
 It contains classes for connecting, fetching data from Sql
Server database. Classes are like as
SqlDataAdapter,SqlDataReader etc.
 System.Data.OracleClient
 It contains classes for connecting, fetching data from Oracle
database. Classes are like as
OracleDataAdapter,OracleDataReader etc.
 System.Data.OleDb
 It contains classes for connecting, fetching data from any
database(like msaccess, db2, oracle, sqlserver, mysql).
Classes are like as OleDbDataAdapter,OleDbDataReader
etc.
 System.Data.Odbc
 It contains classes for connecting, fetching data from any
ADO.NET Architecture
Component of ADO.NET
architecture
 The two key components of ADO.NET are
 Data Providers
 DataSet
DataSet
 Basically it is a small Data structure that may
contain multiple datatables from multiple sources.
 The information in dataset is created inform of
XML and is stored with .xsd extention.
 It support disconnected mode of data access.It
has both scrolling mode means forward and
backward scrolling mode (fetching of data).
 DataSet can have multiple Datatable from
multiple sources but DataReader is able toread
only single Datatable.
Creating and using a DataSet
 The typical steps in creating and using a DataSet
are:
 (i)Create a DataSet object
 (ii) Connect to a database
 (iii)Fill the DataSet with one or more tables or views
 (iv)Disconnect from the database
 (v)Use the DataSet in the application
Data Provider
 Data provider is a set of ADO.Net classes that allow us to
access a database. Basically, it is a bridge between our
application (We can say front-end) and data source. There
are following Data Provider :
 SqlServer Data Provider:-It is used to access data from SqlServer
database (for version 7.0 or later).
 Oracle Data Provider:-It is used to access data from oracle
database (for version 8i or later).
 OleDb Data Provider:-It is used to access data from any database
(msaccess, mysql, db2).
 Odbc Data Provider :-It is used to access data from any database
(msaccess, mysql, db2).
 The four Objects from the .Net Framework provides
the functionality of Data Providers in the ADO.NET.
They are
 Connection Object
 Command Object
 Data Reader Object
 Data Adapter Object.
The SQLCONNECTION OBJECT
 The Connection :-The Connection object which
provides a connection to the database
Command Object
 The Command :-The Command object which is
used to execute a command
 It provide three methods which are used to
execute commands on the database:
 ExecuteNonQuery: Executes commands that
have no return values such as INSERT, UPDATE
or DELETE
 ExecuteScalar : Returns a single value from a
database query
 ExecuteReader: Returns a result set by way of a
DataReader object
Data Adapter Object.
 data adapter : The DataAdapter serve as a bridge
between a DataSet and data source for retrieving and
saving data.
 The DataAdapter provides this bridge by using Fill to load
data from the data source into the DataSet and using
Update to send changes made in the DataSet back to the
data source.
 The data adapter objects connect a command objects to a
Dataset object.
 They provide the means for the exchange of data
between the data store and the tables in the DataSet.
 An OleDbDataAdapter object is used with an OLE-DB
provider A SqlDataAdapter object uses Tabular Data
Services with MS SQL Server.
Data Reader Object
 The DataReader:- The DataReader object which
provides a forward-only, read only, connected
recordset
 Limitations of the DataReader
 There is not possible to sort, filter, or manipulate the
data while using a DataReader, since it is read-only
and forward-only.
Differences between DataSet and
DataReader
DataSet DataReader
DataSet object can contain multiple
rowsets from the same data source as
well as from the relationships between
them.
DataReader provides forward-only and
read-only access to data.
Dataset is a disconnected architecture. Datareader is connected architecture.
Dataset can persist data. Datareader can not persist data.
A DataSet is well suited for data that
needs to be retrieved from multiple
tables.
It has live connection while reading
data
DatsSet is slower than DataReader
,Due to overhead.
Speed performance is better in
DataReader

Weitere ähnliche Inhalte

Was ist angesagt?

OOP Introduction with java programming language
OOP Introduction with java programming languageOOP Introduction with java programming language
OOP Introduction with java programming languageMd.Al-imran Roton
 
The Basics of MongoDB
The Basics of MongoDBThe Basics of MongoDB
The Basics of MongoDBvaluebound
 
15. Transactions in DBMS
15. Transactions in DBMS15. Transactions in DBMS
15. Transactions in DBMSkoolkampus
 
Java Server Pages(jsp)
Java Server Pages(jsp)Java Server Pages(jsp)
Java Server Pages(jsp)Manisha Keim
 
Socket programming in Java (PPTX)
Socket programming in Java (PPTX)Socket programming in Java (PPTX)
Socket programming in Java (PPTX)UC San Diego
 
Client server architecture
Client server architectureClient server architecture
Client server architectureRituBhargava7
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object ModelWebStackAcademy
 
Transaction management DBMS
Transaction  management DBMSTransaction  management DBMS
Transaction management DBMSMegha Patel
 
Enterprise java unit-2_chapter-3
Enterprise  java unit-2_chapter-3Enterprise  java unit-2_chapter-3
Enterprise java unit-2_chapter-3sandeep54552
 
Concurrency Control in Database Management System
Concurrency Control in Database Management SystemConcurrency Control in Database Management System
Concurrency Control in Database Management SystemJanki Shah
 
Java Exception handling
Java Exception handlingJava Exception handling
Java Exception handlingkamal kotecha
 
JDBC: java DataBase connectivity
JDBC: java DataBase connectivityJDBC: java DataBase connectivity
JDBC: java DataBase connectivityTanmoy Barman
 
Jdbc architecture and driver types ppt
Jdbc architecture and driver types pptJdbc architecture and driver types ppt
Jdbc architecture and driver types pptkamal kotecha
 

Was ist angesagt? (20)

Servlets
ServletsServlets
Servlets
 
Servlets
ServletsServlets
Servlets
 
Web services SOAP
Web services SOAPWeb services SOAP
Web services SOAP
 
OOP Introduction with java programming language
OOP Introduction with java programming languageOOP Introduction with java programming language
OOP Introduction with java programming language
 
The Basics of MongoDB
The Basics of MongoDBThe Basics of MongoDB
The Basics of MongoDB
 
15. Transactions in DBMS
15. Transactions in DBMS15. Transactions in DBMS
15. Transactions in DBMS
 
Java Server Pages(jsp)
Java Server Pages(jsp)Java Server Pages(jsp)
Java Server Pages(jsp)
 
ADO.NET
ADO.NETADO.NET
ADO.NET
 
Socket programming in Java (PPTX)
Socket programming in Java (PPTX)Socket programming in Java (PPTX)
Socket programming in Java (PPTX)
 
Client server architecture
Client server architectureClient server architecture
Client server architecture
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
 
Transaction management DBMS
Transaction  management DBMSTransaction  management DBMS
Transaction management DBMS
 
Enterprise java unit-2_chapter-3
Enterprise  java unit-2_chapter-3Enterprise  java unit-2_chapter-3
Enterprise java unit-2_chapter-3
 
Sdi & mdi
Sdi & mdiSdi & mdi
Sdi & mdi
 
Jsp ppt
Jsp pptJsp ppt
Jsp ppt
 
Concurrency Control in Database Management System
Concurrency Control in Database Management SystemConcurrency Control in Database Management System
Concurrency Control in Database Management System
 
Java Exception handling
Java Exception handlingJava Exception handling
Java Exception handling
 
JDBC: java DataBase connectivity
JDBC: java DataBase connectivityJDBC: java DataBase connectivity
JDBC: java DataBase connectivity
 
Jdbc architecture and driver types ppt
Jdbc architecture and driver types pptJdbc architecture and driver types ppt
Jdbc architecture and driver types ppt
 
C# Delegates
C# DelegatesC# Delegates
C# Delegates
 

Andere mochten auch

Chapter 1
Chapter 1Chapter 1
Chapter 1Uma Sam
 
Difference between vbscript and javascript
Difference between vbscript and javascriptDifference between vbscript and javascript
Difference between vbscript and javascriptUmar Ali
 
ADO.NET difference faqs compiled- 1
ADO.NET difference  faqs compiled- 1ADO.NET difference  faqs compiled- 1
ADO.NET difference faqs compiled- 1Umar Ali
 
Dotnet difference questions and answers compiled- 1(updated-2)
Dotnet difference questions and answers compiled- 1(updated-2)Dotnet difference questions and answers compiled- 1(updated-2)
Dotnet difference questions and answers compiled- 1(updated-2)Umar Ali
 
ASP.NET Tutorial - Presentation 1
ASP.NET Tutorial - Presentation 1ASP.NET Tutorial - Presentation 1
ASP.NET Tutorial - Presentation 1Kumar S
 

Andere mochten auch (11)

ADO.NET -database connection
ADO.NET -database connectionADO.NET -database connection
ADO.NET -database connection
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
Difference between vbscript and javascript
Difference between vbscript and javascriptDifference between vbscript and javascript
Difference between vbscript and javascript
 
ADO.NET difference faqs compiled- 1
ADO.NET difference  faqs compiled- 1ADO.NET difference  faqs compiled- 1
ADO.NET difference faqs compiled- 1
 
Dotnet difference questions and answers compiled- 1(updated-2)
Dotnet difference questions and answers compiled- 1(updated-2)Dotnet difference questions and answers compiled- 1(updated-2)
Dotnet difference questions and answers compiled- 1(updated-2)
 
Client and server side scripting
Client and server side scriptingClient and server side scripting
Client and server side scripting
 
Ado.net
Ado.netAdo.net
Ado.net
 
ASP.NET 09 - ADO.NET
ASP.NET 09 - ADO.NETASP.NET 09 - ADO.NET
ASP.NET 09 - ADO.NET
 
For Beginers - ADO.Net
For Beginers - ADO.NetFor Beginers - ADO.Net
For Beginers - ADO.Net
 
ASP.NET Tutorial - Presentation 1
ASP.NET Tutorial - Presentation 1ASP.NET Tutorial - Presentation 1
ASP.NET Tutorial - Presentation 1
 
Asp.net.
Asp.net.Asp.net.
Asp.net.
 

Ähnlich wie Ado.Net Tutorial

Ähnlich wie Ado.Net Tutorial (20)

Ado
AdoAdo
Ado
 
Introduction to ado
Introduction to adoIntroduction to ado
Introduction to ado
 
PPT temp.pptx
PPT temp.pptxPPT temp.pptx
PPT temp.pptx
 
Session x(ado.net)
Session x(ado.net)Session x(ado.net)
Session x(ado.net)
 
Introduction to ado.net
Introduction to ado.netIntroduction to ado.net
Introduction to ado.net
 
Chap14 ado.net
Chap14 ado.netChap14 ado.net
Chap14 ado.net
 
Ado.net
Ado.netAdo.net
Ado.net
 
Database programming in vb net
Database programming in vb netDatabase programming in vb net
Database programming in vb net
 
Unit4
Unit4Unit4
Unit4
 
Ado.net
Ado.netAdo.net
Ado.net
 
ado.net
ado.netado.net
ado.net
 
What is ado .net architecture_.pdf
What is ado .net architecture_.pdfWhat is ado .net architecture_.pdf
What is ado .net architecture_.pdf
 
Ado
AdoAdo
Ado
 
Is2215 lecture7 lecturer_ado_intro
Is2215 lecture7 lecturer_ado_introIs2215 lecture7 lecturer_ado_intro
Is2215 lecture7 lecturer_ado_intro
 
ADO .NET by Sonu Vishwakarma
ADO .NET by Sonu VishwakarmaADO .NET by Sonu Vishwakarma
ADO .NET by Sonu Vishwakarma
 
Ado.net
Ado.netAdo.net
Ado.net
 
Ado Net
Ado NetAdo Net
Ado Net
 
Ado.Net Architecture
Ado.Net ArchitectureAdo.Net Architecture
Ado.Net Architecture
 
Ado dot net complete meterial (1)
Ado dot net complete meterial (1)Ado dot net complete meterial (1)
Ado dot net complete meterial (1)
 
ADO.NET by ASP.NET Development Company in india
ADO.NET by ASP.NET  Development Company in indiaADO.NET by ASP.NET  Development Company in india
ADO.NET by ASP.NET Development Company in india
 

Kürzlich hochgeladen

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 

Kürzlich hochgeladen (20)

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 

Ado.Net Tutorial

  • 2. Introduction to Ado.net  Ado stand for Active Database Object.  Before Ado.net we use Ado to access data from database. Basically Ado has automatic driver detection technique and its has only one drawback that it only provide a connected environment so efficiency of system may decrease.  ADO.NET is a new database technology used by .NET platform (introduced in 2002).  In fact it is a set of classes used to communicate between an application front end and a database.  It supports both connected & disconnection mode of data access.
  • 3. Difference between ADO and ADO.NET ADO ADO.NET 1.It is a COM based library. 1.It is a CLR based library. 2.Classic ADO requires active connection with the data store. 2.ADO.NET architecture works while the data store is disconnected. 3.Locking feature is available. 3.Locking feature is not available. 4.Data is stored in binary format. 4.Data is stored in XML. 5.XML integration is not possible. 5.XML integration is possible. 6.It uses the object named Recordset to reference data from the data store. 6.It uses Dataset Object for data access and representation. 7.Using Classic ADO, we can obtain information from one table or set of tables through join. We cannot fetch records from multiple tables independently. 7.Dataset object of ADO.NET includes collection of DataTables wherein each DataTable will contain records fetched from a particular table. Hence multiple table records are maintained independently. 8.Firewall might prevent execution of Classic ADO. 8.ADO.NET has firewall proof and its execution will never be interrupted. 9.Classic ADO architecture includes client side cursor and server side cursor. 9.ADO.NET architecture doesn't include such cursors. 10.We cannot send multiple transactions using a single connection instance. 10.We can send multiple transactions using a single connection instance.
  • 4. Namespaces used in ADO. Net  System.Data  It contains the common classes for connecting, fetching data from database. Classes are like as DataTable, DataSet, DataView etc.  System.Data.SqlClient  It contains classes for connecting, fetching data from Sql Server database. Classes are like as SqlDataAdapter,SqlDataReader etc.  System.Data.OracleClient  It contains classes for connecting, fetching data from Oracle database. Classes are like as OracleDataAdapter,OracleDataReader etc.  System.Data.OleDb  It contains classes for connecting, fetching data from any database(like msaccess, db2, oracle, sqlserver, mysql). Classes are like as OleDbDataAdapter,OleDbDataReader etc.  System.Data.Odbc  It contains classes for connecting, fetching data from any
  • 6. Component of ADO.NET architecture  The two key components of ADO.NET are  Data Providers  DataSet
  • 7. DataSet  Basically it is a small Data structure that may contain multiple datatables from multiple sources.  The information in dataset is created inform of XML and is stored with .xsd extention.  It support disconnected mode of data access.It has both scrolling mode means forward and backward scrolling mode (fetching of data).  DataSet can have multiple Datatable from multiple sources but DataReader is able toread only single Datatable.
  • 8. Creating and using a DataSet  The typical steps in creating and using a DataSet are:  (i)Create a DataSet object  (ii) Connect to a database  (iii)Fill the DataSet with one or more tables or views  (iv)Disconnect from the database  (v)Use the DataSet in the application
  • 9. Data Provider  Data provider is a set of ADO.Net classes that allow us to access a database. Basically, it is a bridge between our application (We can say front-end) and data source. There are following Data Provider :  SqlServer Data Provider:-It is used to access data from SqlServer database (for version 7.0 or later).  Oracle Data Provider:-It is used to access data from oracle database (for version 8i or later).  OleDb Data Provider:-It is used to access data from any database (msaccess, mysql, db2).  Odbc Data Provider :-It is used to access data from any database (msaccess, mysql, db2).
  • 10.  The four Objects from the .Net Framework provides the functionality of Data Providers in the ADO.NET. They are  Connection Object  Command Object  Data Reader Object  Data Adapter Object.
  • 11. The SQLCONNECTION OBJECT  The Connection :-The Connection object which provides a connection to the database
  • 12. Command Object  The Command :-The Command object which is used to execute a command  It provide three methods which are used to execute commands on the database:  ExecuteNonQuery: Executes commands that have no return values such as INSERT, UPDATE or DELETE  ExecuteScalar : Returns a single value from a database query  ExecuteReader: Returns a result set by way of a DataReader object
  • 13. Data Adapter Object.  data adapter : The DataAdapter serve as a bridge between a DataSet and data source for retrieving and saving data.  The DataAdapter provides this bridge by using Fill to load data from the data source into the DataSet and using Update to send changes made in the DataSet back to the data source.  The data adapter objects connect a command objects to a Dataset object.  They provide the means for the exchange of data between the data store and the tables in the DataSet.  An OleDbDataAdapter object is used with an OLE-DB provider A SqlDataAdapter object uses Tabular Data Services with MS SQL Server.
  • 14. Data Reader Object  The DataReader:- The DataReader object which provides a forward-only, read only, connected recordset  Limitations of the DataReader  There is not possible to sort, filter, or manipulate the data while using a DataReader, since it is read-only and forward-only.
  • 15. Differences between DataSet and DataReader DataSet DataReader DataSet object can contain multiple rowsets from the same data source as well as from the relationships between them. DataReader provides forward-only and read-only access to data. Dataset is a disconnected architecture. Datareader is connected architecture. Dataset can persist data. Datareader can not persist data. A DataSet is well suited for data that needs to be retrieved from multiple tables. It has live connection while reading data DatsSet is slower than DataReader ,Due to overhead. Speed performance is better in DataReader