SlideShare ist ein Scribd-Unternehmen logo
1 von 28
ADO.NETADO.NET
.NET Data Access and Manipulation
Dr. Sonali Vyas
OverviewOverview
What is ADO.NET?
ADO.NET Architecture
Ado.NET Data Providers
ADO.NET Core Objects
Disconnected Data Objects
Connected Data Objects
Understanding .NET Data Providers
What is ADO.NET?What is ADO.NET?
A data-access technology that enables
applications to connect to data stores and
manipulate data contained in them in
various ways
An object oriented framework that allows
you to interact with database systems
Objective of ADO.NETObjective of ADO.NET
Support disconnected data architecture,
Tight integration with XML,
Common data representation
Ability to combine data from multiple
and varied data sources
Optimized facilities for interacting with a
database
ADO.NET ArchitectureADO.NET Architecture
ADO.NETADO.NET Data ProvidersData Providers
Core namespace: System.Data
.NET Framework data providers:
Data Provider Namespace
SQL Server System.Data.SqlClient
OLE DB System.Data.OleDb
ODBC System.Data.Odbc
Oracle System.Data.OracleClient
ADO.NET Core ObjectsADO.NET Core Objects
Object Description
Connection Establishes a connection to a specific data source.
(Base class: DbConnection)
Command Executes a command against a data source. Exposes
Parameters and can execute within the scope of a
Transaction from a Connection. (The base class:
DbCommand)
DataReader Reads a forward-only, read-only stream of data from a
data source. (Base class: DbDataReader)
DataAdapter Populates a DataSet and resolves updates with the
data source. (Base class: DbDataAdapter)
DataTable Has a collection of DataRows and DataColumns
representing table data, used in disconnected
model
DataSet Represents a cache of data. Consists of a set of
DataTables and relations among them
Connection objectConnection object
Connects to databases.
Two provider-specific classes
oSqlConnection
oOleDbConnection.
Connections can be opened in two ways:
oExplicitly by calling the Open method on the
connection
oImplicitly when using a DataAdapter.
Connections handle transactions
Connection (Cont.)Connection (Cont.)
String connString = string.Empty;
connString = “server = sqlexpress; integrated security =
true”; // Window Authentication
//OR
connString = “server = sqlexpress; user id = sa; password =
1234567”; // SQL Authentication
SqlConnection conn = new SqlConnection(connString);
Conn.Open();
//
// Code
//
Conn.Close();
ConnectedConnected DataData ObjectsObjects
ADO.NET’s connected architecture relies on a
consistent database connection to access data and
perform any operations on the retrieved data.
ADO.NET offers the following objects to help you
build your application with a connected
architecture:
• Command
• DataReader
Command ObjectCommand Object
 Information submitted to a database as a query via a
Connection object
 Two provider-specific classes
o SqlCommand
o OleDbCommand
 Input and output parameters are supported, along with
return values as part of the command syntax
 Results are returned in the form of streams. Accessed
by:
o DataReader object
o DataSet object via a DataAdapter
Command (Cont.)Command (Cont.)
Commands have several different methods for executing
SQL. The differences between these methods depend on
the results you expect from the SQL.
Queries return rows of data (result sets), but the INSERT,
UPDATE, and DELETE statements don’t.
DataReader ObjectDataReader Object
Provides methods and properties that deliver a
forward-only stream of data rows from a data
source
When a DataReader is used, parts of the
ADO.NET model are cut out, providing faster
and more efficient data access
Connected Data Access ModelConnected Data Access Model
Steps of Data Acces : ConnectedSteps of Data Acces : Connected
EnvironmentEnvironment
Create connection
Create command (select-insert-update-delete)
Open connection
If SELECT -> use a DataReader to fetch data
If UPDATE,DELETE, INSERT -> use command
object’s methods
Close connection
Disconnected Data ObjectsDisconnected Data Objects
ADO.NET’s disconnected architecture offers
flexible application design and helps organizations
save database connections. ADO.NET offers the
following objects to help you build your
application with a disconnected architecture:
•DataAdapter
• DataSet
DataAdapter ObjectDataAdapter Object
Provides a set of methods and properties to
retrieve and save data between a DataSet and
its source data store
Allows the use of stored procedures
Connects to the database to fill the DataSet and
also update the database
DataSet ObjectDataSet Object
Replaces the ADO Recordset
Represents a cache of data that contains tables,
columns, relationships, and constraints, just like
a database
Regardless of where the source data comes
from, data can all be placed into DataSet
objects
• Tracks changes that are made to the data it
holds before updating the source data
 DataTable
 DataColumn
 DataRow
DataSet (Cont.)DataSet (Cont.)
Disconnected Data Access ModelDisconnected Data Access Model
Steps of Data Access: DisconnectedSteps of Data Access: Disconnected
EnvironmentEnvironment
Defining the connection string
Defining the connection
Defining the command
Defining the data adapter
Creating a new DataSet object
SELECT -> fill the dataset object with the result of
the query through the data adapter
Reading the records from the DataTables in the
datasets using the DataRow and DataColumn
objects
UPDATE, INSERT or DELETE -> update the
database through the data adapter
Pros and ConsPros and Cons
Connected Disconnected
Database
Resources
- +
Network Traffic - +
Memory Usage + -
Data Access - +
Understanding .NET Data ProvidersUnderstanding .NET Data Providers
Commonly Used SqlClient ClassesCommonly Used SqlClient Classes
Commonly Used OleDb ClassesCommonly Used OleDb Classes
Commonly Used Odbc ClassesCommonly Used Odbc Classes
SummarySummary
This presentation was about two main types of
data access that are provided from ADO.NET;
Connected Data Objects and Disconnected Data
Objects. Both types have their own advantages
to fulfill the full-functionality to access data. Both
types have their own main components.
•Connected Data Objects : Connection,
Command, and DataReader.
•Disconnected Data Objects : DataSet,
DataAdapter, DataTable, DataColumn and
DataRow.
Thank you!!!Thank you!!!

Weitere ähnliche Inhalte

Was ist angesagt? (20)

ADO.NET
ADO.NETADO.NET
ADO.NET
 
C# Delegates
C# DelegatesC# Delegates
C# Delegates
 
Ch06 ado.net fundamentals
Ch06 ado.net fundamentalsCh06 ado.net fundamentals
Ch06 ado.net fundamentals
 
Servlets
ServletsServlets
Servlets
 
Jdbc ppt
Jdbc pptJdbc ppt
Jdbc ppt
 
4.C#
4.C#4.C#
4.C#
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
 
SQL Basics
SQL BasicsSQL Basics
SQL Basics
 
MySQL and its basic commands
MySQL and its basic commandsMySQL and its basic commands
MySQL and its basic commands
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQL
 
Databind in asp.net
Databind in asp.netDatabind in asp.net
Databind in asp.net
 
Asp.net state management
Asp.net state managementAsp.net state management
Asp.net state management
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
 
Xml
XmlXml
Xml
 
Introduction to ado.net
Introduction to ado.netIntroduction to ado.net
Introduction to ado.net
 
Webservices
WebservicesWebservices
Webservices
 
Web controls
Web controlsWeb controls
Web controls
 
Asp.net.
Asp.net.Asp.net.
Asp.net.
 
VB.net
VB.netVB.net
VB.net
 
Collection Framework in java
Collection Framework in javaCollection Framework in java
Collection Framework in java
 

Ähnlich wie ADO .Net (20)

Introduction to ado
Introduction to adoIntroduction to ado
Introduction to ado
 
ADO.net control
ADO.net controlADO.net control
ADO.net control
 
Ado.net
Ado.netAdo.net
Ado.net
 
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
AdoAdo
Ado
 
Ado.net
Ado.netAdo.net
Ado.net
 
PPT temp.pptx
PPT temp.pptxPPT temp.pptx
PPT temp.pptx
 
Ado.net
Ado.netAdo.net
Ado.net
 
Data management with ado
Data management with adoData management with ado
Data management with ado
 
ADO .NET by Sonu Vishwakarma
ADO .NET by Sonu VishwakarmaADO .NET by Sonu Vishwakarma
ADO .NET by Sonu Vishwakarma
 
Unit4
Unit4Unit4
Unit4
 
Ado .net
Ado .netAdo .net
Ado .net
 
Is2215 lecture7 lecturer_ado_intro
Is2215 lecture7 lecturer_ado_introIs2215 lecture7 lecturer_ado_intro
Is2215 lecture7 lecturer_ado_intro
 
Marmagna desai
Marmagna desaiMarmagna desai
Marmagna desai
 
5.C#
5.C#5.C#
5.C#
 
WEB PROGRAMMING USING ASP.NET
WEB PROGRAMMING USING ASP.NETWEB PROGRAMMING USING ASP.NET
WEB PROGRAMMING USING ASP.NET
 
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
 
6 database
6 database 6 database
6 database
 

Kürzlich hochgeladen

Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 

Kürzlich hochgeladen (20)

Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

ADO .Net

  • 1. ADO.NETADO.NET .NET Data Access and Manipulation Dr. Sonali Vyas
  • 2. OverviewOverview What is ADO.NET? ADO.NET Architecture Ado.NET Data Providers ADO.NET Core Objects Disconnected Data Objects Connected Data Objects Understanding .NET Data Providers
  • 3. What is ADO.NET?What is ADO.NET? A data-access technology that enables applications to connect to data stores and manipulate data contained in them in various ways An object oriented framework that allows you to interact with database systems
  • 4. Objective of ADO.NETObjective of ADO.NET Support disconnected data architecture, Tight integration with XML, Common data representation Ability to combine data from multiple and varied data sources Optimized facilities for interacting with a database
  • 6. ADO.NETADO.NET Data ProvidersData Providers Core namespace: System.Data .NET Framework data providers: Data Provider Namespace SQL Server System.Data.SqlClient OLE DB System.Data.OleDb ODBC System.Data.Odbc Oracle System.Data.OracleClient
  • 7. ADO.NET Core ObjectsADO.NET Core Objects Object Description Connection Establishes a connection to a specific data source. (Base class: DbConnection) Command Executes a command against a data source. Exposes Parameters and can execute within the scope of a Transaction from a Connection. (The base class: DbCommand) DataReader Reads a forward-only, read-only stream of data from a data source. (Base class: DbDataReader) DataAdapter Populates a DataSet and resolves updates with the data source. (Base class: DbDataAdapter) DataTable Has a collection of DataRows and DataColumns representing table data, used in disconnected model DataSet Represents a cache of data. Consists of a set of DataTables and relations among them
  • 8. Connection objectConnection object Connects to databases. Two provider-specific classes oSqlConnection oOleDbConnection. Connections can be opened in two ways: oExplicitly by calling the Open method on the connection oImplicitly when using a DataAdapter. Connections handle transactions
  • 9. Connection (Cont.)Connection (Cont.) String connString = string.Empty; connString = “server = sqlexpress; integrated security = true”; // Window Authentication //OR connString = “server = sqlexpress; user id = sa; password = 1234567”; // SQL Authentication SqlConnection conn = new SqlConnection(connString); Conn.Open(); // // Code // Conn.Close();
  • 10. ConnectedConnected DataData ObjectsObjects ADO.NET’s connected architecture relies on a consistent database connection to access data and perform any operations on the retrieved data. ADO.NET offers the following objects to help you build your application with a connected architecture: • Command • DataReader
  • 11. Command ObjectCommand Object  Information submitted to a database as a query via a Connection object  Two provider-specific classes o SqlCommand o OleDbCommand  Input and output parameters are supported, along with return values as part of the command syntax  Results are returned in the form of streams. Accessed by: o DataReader object o DataSet object via a DataAdapter
  • 12. Command (Cont.)Command (Cont.) Commands have several different methods for executing SQL. The differences between these methods depend on the results you expect from the SQL. Queries return rows of data (result sets), but the INSERT, UPDATE, and DELETE statements don’t.
  • 13. DataReader ObjectDataReader Object Provides methods and properties that deliver a forward-only stream of data rows from a data source When a DataReader is used, parts of the ADO.NET model are cut out, providing faster and more efficient data access
  • 14. Connected Data Access ModelConnected Data Access Model
  • 15. Steps of Data Acces : ConnectedSteps of Data Acces : Connected EnvironmentEnvironment Create connection Create command (select-insert-update-delete) Open connection If SELECT -> use a DataReader to fetch data If UPDATE,DELETE, INSERT -> use command object’s methods Close connection
  • 16. Disconnected Data ObjectsDisconnected Data Objects ADO.NET’s disconnected architecture offers flexible application design and helps organizations save database connections. ADO.NET offers the following objects to help you build your application with a disconnected architecture: •DataAdapter • DataSet
  • 17. DataAdapter ObjectDataAdapter Object Provides a set of methods and properties to retrieve and save data between a DataSet and its source data store Allows the use of stored procedures Connects to the database to fill the DataSet and also update the database
  • 18. DataSet ObjectDataSet Object Replaces the ADO Recordset Represents a cache of data that contains tables, columns, relationships, and constraints, just like a database Regardless of where the source data comes from, data can all be placed into DataSet objects • Tracks changes that are made to the data it holds before updating the source data  DataTable  DataColumn  DataRow
  • 20. Disconnected Data Access ModelDisconnected Data Access Model
  • 21. Steps of Data Access: DisconnectedSteps of Data Access: Disconnected EnvironmentEnvironment Defining the connection string Defining the connection Defining the command Defining the data adapter Creating a new DataSet object SELECT -> fill the dataset object with the result of the query through the data adapter Reading the records from the DataTables in the datasets using the DataRow and DataColumn objects UPDATE, INSERT or DELETE -> update the database through the data adapter
  • 22. Pros and ConsPros and Cons Connected Disconnected Database Resources - + Network Traffic - + Memory Usage + - Data Access - +
  • 23. Understanding .NET Data ProvidersUnderstanding .NET Data Providers
  • 24. Commonly Used SqlClient ClassesCommonly Used SqlClient Classes
  • 25. Commonly Used OleDb ClassesCommonly Used OleDb Classes
  • 26. Commonly Used Odbc ClassesCommonly Used Odbc Classes
  • 27. SummarySummary This presentation was about two main types of data access that are provided from ADO.NET; Connected Data Objects and Disconnected Data Objects. Both types have their own advantages to fulfill the full-functionality to access data. Both types have their own main components. •Connected Data Objects : Connection, Command, and DataReader. •Disconnected Data Objects : DataSet, DataAdapter, DataTable, DataColumn and DataRow.