SlideShare a Scribd company logo
1 of 18
By –Om Prakash Kumar
ADO.NET
The database access technologies we used, including components for
retrieving data, storing data in memory, and binding data to controls,
are collectively called ADO.NET .
ADO.NET is designed to provide a disconnected architecture
If the database needs to be updated with changes made to the in -
memory copy, a new connection is made and the database is updated
ADO.Net is a model, a part of the .Net framework that is used by the
.Net applications for retrieving, accessing and updating data.
System.Data -> The non provider specific (non database
aware classes) are
located in System.Data.
System.Data.SQLClient -> Managed Provider for SQL Server.
This gives the best performance for SQL Server running
directly over the SQL
Server Tabular Data Stream (TDS) protocol.
System.Data.OleDB -> Managed Provider for OleDB
Providers. This provides
access to any OleDB Provider.
ADO.NET Namespaces
ADO.NET is comprised of many classes, but five take center stage:
Connection - Represents a connection to a data source.
Command - Represents a query or a command that is to be executed by
a data source.
DataSet - Represents data. The DataSet can be filled either from a data
source (using a DataAdapter object) or dynamically.
DataAdapter - Used for filling a DataSet from a data source.
DataReader - Used for fast, efficient, forward-only reading of a data
source
ADO.NET
ADO.NET Architecture Diagram
Benefits of ADO.NET
 Interoperability through use of XML:
 Open standard for data that describes itself
 Human readable and decipherable text
 Used internally but accessible externally
 Can use XML to read and write and move data
 Scalability through the disconnected DataSet
 Connections are not maintained for long periods
 Database locking does not occur
 Locking support with ServiceComponents
 Optimistic locking otherwise
 Works the way the Web works: “Hit and Run!”
 Maintainability
 Separation of data logic and user interface
The data residing in a data store or database is
retrieved through the data provider. Various
components of the data provider, retrieves data for the
application and update data.
A data provider is used for connecting to a database,
executing commands and retrieving data, storing it in a
dataset, reading the retrieved data and updating the
database.
Data Provider
The data provider in ADO .NET consists of the following four objects:
1.) Connection:
This component is used to set up a connection with a data source.
2.) Command:
A command is a SQL statement or a stored procedure used to
retrieve, insert, delete or modify data in a data source.
Data Provider (Cont..)
3.) DataReader :
Data reader is used to retrieve data from a data source in a
read-only and forward-only mode.
4.) DataAdapter :
This is integral to the working of ADO.NET since 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.
Cont ..
DataSet is an in-memory representation of data. It is a
disconnected, cached set of records that are retrieved from a
database.
The dataset works as a virtual database, containing tables, rows,
and columns.
The DataSet class is present in the System.Data namespace.
DataSet
The following are the components of DataSet :
1.) DataTableCollection:
It contains all the tables retrieved from the data source.
2 .)DataRelationCollection:
It contains relationships and the links between tables in a data set.
3 .)ExtendedProperties:
It contains additional information, like the SQL statement for retrieving
data, time of retrieval etc.
4 .)DataTable:
It represents a table in the DataTableCollection of a dataset. It consists of
the dataRow and dataColumn objects.
DataSet
5.) DataRelation:
It represents a relationship in the DataRelationshipCollection of the
dataset. It is used to relate two DataTable
objects to each other through the DataColumn objects.
6 .)DataRowCollection:
It contains all the rows in a DataTable.
7 .)DataView:
It represents a fixed customized view of a DataTable for sorting,
filtering, searching, editing and navigation.
8 .)PrimaryKey:
It represents the column that uniquely identifies a row in a
DataTable.
DataSet
9.) DataRow :
It represents a row in the DataTable. The DataRow object and its
properties and methods are used to retrieve, evaluate, insert,
delete, and update values in the DataTable. The NewRow method
is used to create a new row and the Add method adds a row to
the table.
10.) DataColumnCollection:
It represents all the columns in a DataTable.
11.) DataColumn:
It consists of the number of columns that comprise a DataTable.
DataSet
Data reader
The DataReader object is initially positioned just prior to the first
row of the result set (and
therefore has to be repositioned before reading any data).
The Read method repositions the DataReader to the next row,
returning True if the
DataReader is positioned onto a valid row and False if the
DataReader is positioned past the
last row in the result set.
The DataReader provides an Item property for reading column
values from the current row.
*SelectCommand
*contains a Command object that can be used to populate a DataTable within
DataSet
*Command object typically references a SQL SELECT statement
*InsertCommand
*to insert rows added to a DataTable into an underlying database
*Command object typically references a SQL INSERT statement
*UpdateCommand
*to update a database based on changes made to a DataTable
*Command object typically references a SQL UPDATE statement
*DeleteCommand
*to delete rows in a database based on deletions made to a DataTable
*Command object typically references a SQL DELETE statement
*
*Fill
*Used to execute a query (in the SelectCommand) and store the result in
a DataSet
*Da.Fill(Ds, “TableName”)
*Note that the connection can be closed once the Fill method is done
*Update
*Used to modify data in the database based on changes made to the
DataTables
TCS2111

More Related Content

What's hot

Hadoop Architecture | HDFS Architecture | Hadoop Architecture Tutorial | HDFS...
Hadoop Architecture | HDFS Architecture | Hadoop Architecture Tutorial | HDFS...Hadoop Architecture | HDFS Architecture | Hadoop Architecture Tutorial | HDFS...
Hadoop Architecture | HDFS Architecture | Hadoop Architecture Tutorial | HDFS...Simplilearn
 
Relational databases vs Non-relational databases
Relational databases vs Non-relational databasesRelational databases vs Non-relational databases
Relational databases vs Non-relational databasesJames Serra
 
Spark rdd vs data frame vs dataset
Spark rdd vs data frame vs datasetSpark rdd vs data frame vs dataset
Spark rdd vs data frame vs datasetAnkit Beohar
 
Major issues in data mining
Major issues in data miningMajor issues in data mining
Major issues in data miningSlideshare
 
Stanford CS347 Guest Lecture: Apache Spark
Stanford CS347 Guest Lecture: Apache SparkStanford CS347 Guest Lecture: Apache Spark
Stanford CS347 Guest Lecture: Apache SparkReynold Xin
 
Data management with ado
Data management with adoData management with ado
Data management with adoDinesh kumar
 
Consuming Web Services in Android
Consuming Web Services in AndroidConsuming Web Services in Android
Consuming Web Services in AndroidDavid Truxall
 
Understanding Data Partitioning and Replication in Apache Cassandra
Understanding Data Partitioning and Replication in Apache CassandraUnderstanding Data Partitioning and Replication in Apache Cassandra
Understanding Data Partitioning and Replication in Apache CassandraDataStax
 
Non relational databases-no sql
Non relational databases-no sqlNon relational databases-no sql
Non relational databases-no sqlRam kumar
 
Introduction to asp.net
Introduction to asp.netIntroduction to asp.net
Introduction to asp.netshan km
 
Classes and Objects
Classes and Objects  Classes and Objects
Classes and Objects yndaravind
 
Entity relationship diagram (erd)
Entity relationship  diagram (erd)Entity relationship  diagram (erd)
Entity relationship diagram (erd)Shahariar Alam
 
Presto @ Uber Hadoop summit2017
Presto @ Uber Hadoop summit2017Presto @ Uber Hadoop summit2017
Presto @ Uber Hadoop summit2017Zhenxiao Luo
 

What's hot (20)

Introduction to ado.net
Introduction to ado.netIntroduction to ado.net
Introduction to ado.net
 
Hadoop Architecture | HDFS Architecture | Hadoop Architecture Tutorial | HDFS...
Hadoop Architecture | HDFS Architecture | Hadoop Architecture Tutorial | HDFS...Hadoop Architecture | HDFS Architecture | Hadoop Architecture Tutorial | HDFS...
Hadoop Architecture | HDFS Architecture | Hadoop Architecture Tutorial | HDFS...
 
Relational databases vs Non-relational databases
Relational databases vs Non-relational databasesRelational databases vs Non-relational databases
Relational databases vs Non-relational databases
 
Spark rdd vs data frame vs dataset
Spark rdd vs data frame vs datasetSpark rdd vs data frame vs dataset
Spark rdd vs data frame vs dataset
 
Major issues in data mining
Major issues in data miningMajor issues in data mining
Major issues in data mining
 
Stanford CS347 Guest Lecture: Apache Spark
Stanford CS347 Guest Lecture: Apache SparkStanford CS347 Guest Lecture: Apache Spark
Stanford CS347 Guest Lecture: Apache Spark
 
Data management with ado
Data management with adoData management with ado
Data management with ado
 
ADO.NET
ADO.NETADO.NET
ADO.NET
 
Data Dictionary
Data DictionaryData Dictionary
Data Dictionary
 
Consuming Web Services in Android
Consuming Web Services in AndroidConsuming Web Services in Android
Consuming Web Services in Android
 
Apache Spark Overview
Apache Spark OverviewApache Spark Overview
Apache Spark Overview
 
Namespaces in C#
Namespaces in C#Namespaces in C#
Namespaces in C#
 
Understanding Data Partitioning and Replication in Apache Cassandra
Understanding Data Partitioning and Replication in Apache CassandraUnderstanding Data Partitioning and Replication in Apache Cassandra
Understanding Data Partitioning and Replication in Apache Cassandra
 
Non relational databases-no sql
Non relational databases-no sqlNon relational databases-no sql
Non relational databases-no sql
 
Data warehouse logical design
Data warehouse logical designData warehouse logical design
Data warehouse logical design
 
Introduction to asp.net
Introduction to asp.netIntroduction to asp.net
Introduction to asp.net
 
NoSQL databases
NoSQL databasesNoSQL databases
NoSQL databases
 
Classes and Objects
Classes and Objects  Classes and Objects
Classes and Objects
 
Entity relationship diagram (erd)
Entity relationship  diagram (erd)Entity relationship  diagram (erd)
Entity relationship diagram (erd)
 
Presto @ Uber Hadoop summit2017
Presto @ Uber Hadoop summit2017Presto @ Uber Hadoop summit2017
Presto @ Uber Hadoop summit2017
 

Similar to Ado.net

What is ado .net architecture_.pdf
What is ado .net architecture_.pdfWhat is ado .net architecture_.pdf
What is ado .net architecture_.pdfAlbert828253
 
Introduction to ado
Introduction to adoIntroduction to ado
Introduction to adoHarman Bajwa
 
Disconnected Architecture and Crystal report in VB.NET
Disconnected Architecture and Crystal report in VB.NETDisconnected Architecture and Crystal report in VB.NET
Disconnected Architecture and Crystal report in VB.NETEverywhere
 
Ado.Net Architecture
Ado.Net ArchitectureAdo.Net Architecture
Ado.Net ArchitectureUmar Farooq
 
Csharp_dotnet_ADO_Net_database_query.pptx
Csharp_dotnet_ADO_Net_database_query.pptxCsharp_dotnet_ADO_Net_database_query.pptx
Csharp_dotnet_ADO_Net_database_query.pptxfacebookrecovery1
 
Ado.net with asp.net
Ado.net with asp.netAdo.net with asp.net
Ado.net with asp.netSireesh K
 
Intake 38 data access 1
Intake 38 data access 1Intake 38 data access 1
Intake 38 data access 1Mahmoud Ouf
 
Ado.net & data persistence frameworks
Ado.net & data persistence frameworksAdo.net & data persistence frameworks
Ado.net & data persistence frameworksLuis Goldster
 
Database programming in vb net
Database programming in vb netDatabase programming in vb net
Database programming in vb netZishan yousaf
 
LECTURE 14 Data Access.pptx
LECTURE 14 Data Access.pptxLECTURE 14 Data Access.pptx
LECTURE 14 Data Access.pptxAOmaAli
 
Visual Basic.Net & Ado.Net
Visual Basic.Net & Ado.NetVisual Basic.Net & Ado.Net
Visual Basic.Net & Ado.NetFaRid Adwa
 
WEB PROGRAMMING USING ASP.NET
WEB PROGRAMMING USING ASP.NETWEB PROGRAMMING USING ASP.NET
WEB PROGRAMMING USING ASP.NETDhruvVekariya3
 
Ado.net session05
Ado.net session05Ado.net session05
Ado.net session05Niit Care
 

Similar to Ado.net (20)

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
 
Introduction to ado
Introduction to adoIntroduction to ado
Introduction to ado
 
Disconnected Architecture and Crystal report in VB.NET
Disconnected Architecture and Crystal report in VB.NETDisconnected Architecture and Crystal report in VB.NET
Disconnected Architecture and Crystal report in VB.NET
 
Ado.Net Architecture
Ado.Net ArchitectureAdo.Net Architecture
Ado.Net Architecture
 
ado.net
ado.netado.net
ado.net
 
Ado.net
Ado.netAdo.net
Ado.net
 
Csharp_dotnet_ADO_Net_database_query.pptx
Csharp_dotnet_ADO_Net_database_query.pptxCsharp_dotnet_ADO_Net_database_query.pptx
Csharp_dotnet_ADO_Net_database_query.pptx
 
Ado.net with asp.net
Ado.net with asp.netAdo.net with asp.net
Ado.net with asp.net
 
Ado
AdoAdo
Ado
 
Session x(ado.net)
Session x(ado.net)Session x(ado.net)
Session x(ado.net)
 
Intake 38 data access 1
Intake 38 data access 1Intake 38 data access 1
Intake 38 data access 1
 
Ado.net & data persistence frameworks
Ado.net & data persistence frameworksAdo.net & data persistence frameworks
Ado.net & data persistence frameworks
 
Database programming in vb net
Database programming in vb netDatabase programming in vb net
Database programming in vb net
 
Unit4
Unit4Unit4
Unit4
 
LECTURE 14 Data Access.pptx
LECTURE 14 Data Access.pptxLECTURE 14 Data Access.pptx
LECTURE 14 Data Access.pptx
 
Visual Basic.Net & Ado.Net
Visual Basic.Net & Ado.NetVisual Basic.Net & Ado.Net
Visual Basic.Net & Ado.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
 
WEB PROGRAMMING USING ASP.NET
WEB PROGRAMMING USING ASP.NETWEB PROGRAMMING USING ASP.NET
WEB PROGRAMMING USING ASP.NET
 
Ado.net session05
Ado.net session05Ado.net session05
Ado.net session05
 

Recently uploaded

Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 

Recently uploaded (20)

Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 

Ado.net

  • 2. ADO.NET The database access technologies we used, including components for retrieving data, storing data in memory, and binding data to controls, are collectively called ADO.NET . ADO.NET is designed to provide a disconnected architecture If the database needs to be updated with changes made to the in - memory copy, a new connection is made and the database is updated ADO.Net is a model, a part of the .Net framework that is used by the .Net applications for retrieving, accessing and updating data.
  • 3. System.Data -> The non provider specific (non database aware classes) are located in System.Data. System.Data.SQLClient -> Managed Provider for SQL Server. This gives the best performance for SQL Server running directly over the SQL Server Tabular Data Stream (TDS) protocol. System.Data.OleDB -> Managed Provider for OleDB Providers. This provides access to any OleDB Provider. ADO.NET Namespaces
  • 4. ADO.NET is comprised of many classes, but five take center stage: Connection - Represents a connection to a data source. Command - Represents a query or a command that is to be executed by a data source. DataSet - Represents data. The DataSet can be filled either from a data source (using a DataAdapter object) or dynamically. DataAdapter - Used for filling a DataSet from a data source. DataReader - Used for fast, efficient, forward-only reading of a data source ADO.NET
  • 6. Benefits of ADO.NET  Interoperability through use of XML:  Open standard for data that describes itself  Human readable and decipherable text  Used internally but accessible externally  Can use XML to read and write and move data  Scalability through the disconnected DataSet  Connections are not maintained for long periods  Database locking does not occur  Locking support with ServiceComponents  Optimistic locking otherwise  Works the way the Web works: “Hit and Run!”  Maintainability  Separation of data logic and user interface
  • 7. The data residing in a data store or database is retrieved through the data provider. Various components of the data provider, retrieves data for the application and update data. A data provider is used for connecting to a database, executing commands and retrieving data, storing it in a dataset, reading the retrieved data and updating the database. Data Provider
  • 8. The data provider in ADO .NET consists of the following four objects: 1.) Connection: This component is used to set up a connection with a data source. 2.) Command: A command is a SQL statement or a stored procedure used to retrieve, insert, delete or modify data in a data source.
  • 9. Data Provider (Cont..) 3.) DataReader : Data reader is used to retrieve data from a data source in a read-only and forward-only mode. 4.) DataAdapter : This is integral to the working of ADO.NET since 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.
  • 11. DataSet is an in-memory representation of data. It is a disconnected, cached set of records that are retrieved from a database. The dataset works as a virtual database, containing tables, rows, and columns. The DataSet class is present in the System.Data namespace. DataSet
  • 12. The following are the components of DataSet : 1.) DataTableCollection: It contains all the tables retrieved from the data source. 2 .)DataRelationCollection: It contains relationships and the links between tables in a data set. 3 .)ExtendedProperties: It contains additional information, like the SQL statement for retrieving data, time of retrieval etc. 4 .)DataTable: It represents a table in the DataTableCollection of a dataset. It consists of the dataRow and dataColumn objects. DataSet
  • 13. 5.) DataRelation: It represents a relationship in the DataRelationshipCollection of the dataset. It is used to relate two DataTable objects to each other through the DataColumn objects. 6 .)DataRowCollection: It contains all the rows in a DataTable. 7 .)DataView: It represents a fixed customized view of a DataTable for sorting, filtering, searching, editing and navigation. 8 .)PrimaryKey: It represents the column that uniquely identifies a row in a DataTable. DataSet
  • 14. 9.) DataRow : It represents a row in the DataTable. The DataRow object and its properties and methods are used to retrieve, evaluate, insert, delete, and update values in the DataTable. The NewRow method is used to create a new row and the Add method adds a row to the table. 10.) DataColumnCollection: It represents all the columns in a DataTable. 11.) DataColumn: It consists of the number of columns that comprise a DataTable. DataSet
  • 15. Data reader The DataReader object is initially positioned just prior to the first row of the result set (and therefore has to be repositioned before reading any data). The Read method repositions the DataReader to the next row, returning True if the DataReader is positioned onto a valid row and False if the DataReader is positioned past the last row in the result set. The DataReader provides an Item property for reading column values from the current row.
  • 16. *SelectCommand *contains a Command object that can be used to populate a DataTable within DataSet *Command object typically references a SQL SELECT statement *InsertCommand *to insert rows added to a DataTable into an underlying database *Command object typically references a SQL INSERT statement *UpdateCommand *to update a database based on changes made to a DataTable *Command object typically references a SQL UPDATE statement *DeleteCommand *to delete rows in a database based on deletions made to a DataTable *Command object typically references a SQL DELETE statement
  • 17. * *Fill *Used to execute a query (in the SelectCommand) and store the result in a DataSet *Da.Fill(Ds, “TableName”) *Note that the connection can be closed once the Fill method is done *Update *Used to modify data in the database based on changes made to the DataTables