SlideShare a Scribd company logo
1 of 14
Developing Database Applications Using ADO.NET and XML
Objectives


                In this session, you will learn to:
                   Identify the connected and disconnected environment in
                   ADO.NET
                   Working in a connected environment




     Ver. 1.0                      Session 4                            Slide 1 of 14
Developing Database Applications Using ADO.NET and XML
Introducing Connected and Disconnected Environment


                A connected environment is one in which a user or an
                application is constantly connected to a data source.
                A connected environment provides the following
                advantages:
                   Data concurrency issues are easier to control.
                   Data is current and updated.
                A connected environment has the following disadvantages:
                   A constant network connection may, sometimes, lead to
                   network traffic logging.
                   Scalability and performance issues in applications.
                Let us now discuss the disconnected environment.




     Ver. 1.0                     Session 4                            Slide 2 of 14
Developing Database Applications Using ADO.NET and XML
Introducing Connected and Disconnected Environment (Contd.)


                In a disconnected environment is one in which a user or an
                application is not directly connected to a data source.
                A disconnected environment provides the following
                advantages:
                   Allows multiple applications to simultaneously interact with the
                   data source.
                   Improves the scalability and performance of applications.
                A disconnected environment has the following
                disadvantages:
                   Data is not always up to date as no proper connection is
                   established with the data source.
                   Data concurrency issues can occur when multiple users are
                   updating the data to the data source.



     Ver. 1.0                      Session 4                               Slide 3 of 14
Developing Database Applications Using ADO.NET and XML
Introducing Connected and Disconnected Environment (Contd.)


                The following figure shows the connected and disconnected
                environment in ADO.NET.




                           XML                          Data Source


     Ver. 1.0                    Session 4                            Slide 4 of 14
Developing Database Applications Using ADO.NET and XML
Working with Command Objects


               A Command object is a specific command that is used to
               manipulate data in a data source in a connected
               environment.
               A Command object represents a DML statement or a stored
               procedure that is used to retrieve, insert, delete, or modify
               data in a data source.
               The two types of operations performed by a command
               object to retrieve and modify data in a data source are:
                  Synchronous operations
                  Asynchronous operations
               Let us discuss these operations in detail.




    Ver. 1.0                     Session 4                           Slide 5 of 14
Developing Database Applications Using ADO.NET and XML
Working with Command Objects (Contd.)


               During synchronous operations, the command objects are
               linked to each other.
               Executing command objects synchronously results in a
               sequential execution, where each database command must
               complete before the next command is executed.
               Synchronous operations are performed with the help of the
               following command objects:
                DbCommand object           Executes a command in a data source
                                            against a valid open connection

                DbParameters object        Assigns parameterized values to stored
                                            procedures

                DbDataReader object        Retrieves a forward-only, read-only data
                                            from the data source




    Ver. 1.0                    Session 4                                         Slide 6 of 14
Developing Database Applications Using ADO.NET and XML
Just a minute


                • Which method of the DbCommand object executes a DML
                  statement against a connection and returns the number of
                  rows affected?
                   1.   ExecuteReader()
                   2.   CreateObjRef()
                   3.   ExecureNonQuery()
                   4.   ExecuteScalar()




                  Answer:
                   3. ExecuteNonQuery()



     Ver. 1.0                      Session 4                         Slide 7 of 14
Developing Database Applications Using ADO.NET and XML
Working with Command Objects (Contd.)


               •   Asynchronous execution of commands enhances the
                   overall performance and responsiveness of the client
                   application.
               •   ADO.NET supports asynchronous execution of commands
                   to enable parallelism by allowing the client application to
                   execute commands while waiting for the response from a
                   previously issued command.
               •   The asynchronous execution of commands is carried out in
                   the SQLCommand class.




    Ver. 1.0                        Session 4                          Slide 8 of 14
Developing Database Applications Using ADO.NET and XML
Working with Command Objects (Contd.)


               •   The SQLCommand class provides the following methods for
                   asynchronous execution of commands:
                    BeginExecuteNonQuery()      Starts the process of asynchronously
                                                 executing a Transact-SQL statement or
                                                 stored procedure that does not return
                                                 rows

                    BeginExecuteReader()        Starts the process of asynchronously
                                                 executing a Transact-SQL statement or
                                                 stored procedure that returns rows


                    BeginExecuteXmlReader()     Initiates the asynchronous execution of
                                                 the Transact-SQL statement or stored
                                                 procedure that is described by the
                                                 SqlCommand and returns the result as
                                                 an XMLReader object




    Ver. 1.0                       Session 4                                 Slide 9 of 14
Developing Database Applications Using ADO.NET and XML
Working with Command Objects (Contd.)


                EndExecuteNonQuery()    Completes the asynchronous execution
                                         of a Transact-SQL statement or stored
                                         procedure


                EndExecuteReader()      Completes the asynchronous execution
                                         of a Transact-SQL statement or a stored
                                         procedure, thereby, returning the
                                         requested SqlDataReader

                EndExecuteXmlReader()   Completes the asynchronous execution
                                         of a Transact-SQL statement or a stored
                                         procedure, thereby, returning XML data




    Ver. 1.0                Session 4                               Slide 10 of 14
Developing Database Applications Using ADO.NET and XML
Working with Command Objects (Contd.)


               Another way of retrieving data asynchronously is by using
               Multiple Active Result Sets (MARS).
               MARS allows the execution of multiple data readers on a
               single connection.
               By default, MARS feature is disabled in an application. You
               can enable MARS in the connection string, as shown in the
               following code snippet:
                String connectionString = "Data
                Source=SQLSERVER01;Initial
                Catalog=AdventureWorks;User
                id=sa;Password=niit#1234;
                MultipleActiveResultSets=True";        Enabling MARS property
                                                       to True




    Ver. 1.0                    Session 4                             Slide 11 of 14
Developing Database Applications Using ADO.NET and XML
Just a minute


                • What is the function of the EndExecuteReader()
                  method of the SqlCommand class?
                   1. Asynchronously executes a stored procedure that returns
                      rows
                   2. Executes the stored procedure and returns the result as an
                      XmlReader object
                   3. Asynchronously executes a stored procedure that does not
                      return rows
                   4. Executes the stored procedure and returns the result as an
                      SqlDataReader object


                  Answer:
                   4. Executes the stored procedure and returns the result as an
                      SqlDataReader object


     Ver. 1.0                        Session 4                             Slide 12 of 14
Developing Database Applications Using ADO.NET and XML
Summary


               In this session, you learned that:
                  A connected environment is one in which a user or an
                  application is constantly connected to a data source.
                  A disconnected environment is one in which a user or an
                  application is not directly connected to a data source.
                  The two types of operations performed by a command object
                  to retrieve and modify data in a data source are:
                    Synchronous operations
                    Asynchronous operations
                 During synchronous operations, the command objects are
                  linked to each other.
                 Synchronous operations are performed with the help of the
                  following command objects:
                    DbCommand object
                    DbParameters object
                    DbDataReader object
    Ver. 1.0                      Session 4                            Slide 13 of 14
Developing Database Applications Using ADO.NET and XML
Summary (Contd.)


                ADO.NET supports asynchronous execution of commands to
                 enable parallelism by allowing the client application to execute
                 commands while waiting for the response from a previously
                 issued command.
                The SqlCommand class provides the following methods for
                 asynchronous operations:
                      BeginExecuteNonQuery()
                      BeginExecuteReader()
                      BeginExecuteXmlReader()
                      EndExecuteNonQuery()
                      EndExecuteReader()
                      EndExecuteXmlReader()
                MARS allows the execution of multiple data readers on a single
                 connection.



    Ver. 1.0                      Session 4                              Slide 14 of 14

More Related Content

What's hot

Visual Basic.Net & Ado.Net
Visual Basic.Net & Ado.NetVisual Basic.Net & Ado.Net
Visual Basic.Net & Ado.NetFaRid Adwa
 
ADO.NET difference faqs compiled- 1
ADO.NET difference  faqs compiled- 1ADO.NET difference  faqs compiled- 1
ADO.NET difference faqs compiled- 1Umar Ali
 
Introduction to ado
Introduction to adoIntroduction to ado
Introduction to adoHarman Bajwa
 
Database programming in vb net
Database programming in vb netDatabase programming in vb net
Database programming in vb netZishan yousaf
 
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
 
JAM819 - Native API Deep Dive: Data Storage and Retrieval
JAM819 - Native API Deep Dive: Data Storage and RetrievalJAM819 - Native API Deep Dive: Data Storage and Retrieval
JAM819 - Native API Deep Dive: Data Storage and RetrievalDr. Ranbijay Kumar
 
PATTERNS07 - Data Representation in C#
PATTERNS07 - Data Representation in C#PATTERNS07 - Data Representation in C#
PATTERNS07 - Data Representation in C#Michael Heron
 
Ado dot net complete meterial (1)
Ado dot net complete meterial (1)Ado dot net complete meterial (1)
Ado dot net complete meterial (1)Mubarak Hussain
 
Web based database application design using vb.net and sql server
Web based database application design using vb.net and sql serverWeb based database application design using vb.net and sql server
Web based database application design using vb.net and sql serverAmmara Arooj
 
Intake 38 data access 1
Intake 38 data access 1Intake 38 data access 1
Intake 38 data access 1Mahmoud Ouf
 
Graph db as metastore
Graph db as metastoreGraph db as metastore
Graph db as metastoreHaris Khan
 

What's hot (20)

Visual Basic.Net & Ado.Net
Visual Basic.Net & Ado.NetVisual Basic.Net & Ado.Net
Visual Basic.Net & Ado.Net
 
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
 
ADO.NET difference faqs compiled- 1
ADO.NET difference  faqs compiled- 1ADO.NET difference  faqs compiled- 1
ADO.NET difference faqs compiled- 1
 
Ado.net
Ado.netAdo.net
Ado.net
 
Introduction to ado
Introduction to adoIntroduction to ado
Introduction to ado
 
Database programming in vb net
Database programming in vb netDatabase programming in vb net
Database programming in vb net
 
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
 
Unit4
Unit4Unit4
Unit4
 
Intake 38 10
Intake 38 10Intake 38 10
Intake 38 10
 
Ado.Net Architecture
Ado.Net ArchitectureAdo.Net Architecture
Ado.Net Architecture
 
JAM819 - Native API Deep Dive: Data Storage and Retrieval
JAM819 - Native API Deep Dive: Data Storage and RetrievalJAM819 - Native API Deep Dive: Data Storage and Retrieval
JAM819 - Native API Deep Dive: Data Storage and Retrieval
 
2310 b 09
2310 b 092310 b 09
2310 b 09
 
Database Connection
Database ConnectionDatabase Connection
Database Connection
 
PATTERNS07 - Data Representation in C#
PATTERNS07 - Data Representation in C#PATTERNS07 - Data Representation in C#
PATTERNS07 - Data Representation in C#
 
Ado dot net complete meterial (1)
Ado dot net complete meterial (1)Ado dot net complete meterial (1)
Ado dot net complete meterial (1)
 
Web based database application design using vb.net and sql server
Web based database application design using vb.net and sql serverWeb based database application design using vb.net and sql server
Web based database application design using vb.net and sql server
 
Intake 38 data access 1
Intake 38 data access 1Intake 38 data access 1
Intake 38 data access 1
 
ODI User and Security
ODI User and Security ODI User and Security
ODI User and Security
 
Graph db as metastore
Graph db as metastoreGraph db as metastore
Graph db as metastore
 

Similar to ADO.NET Database Apps Connected Disconnected XML

ASP.NET Session 11 12
ASP.NET Session 11 12ASP.NET Session 11 12
ASP.NET Session 11 12Sisir Ghosh
 
Ado.net & data persistence frameworks
Ado.net & data persistence frameworksAdo.net & data persistence frameworks
Ado.net & data persistence frameworksLuis Goldster
 
Linq to xml
Linq to xmlLinq to xml
Linq to xmlMickey
 
LECTURE 14 Data Access.pptx
LECTURE 14 Data Access.pptxLECTURE 14 Data Access.pptx
LECTURE 14 Data Access.pptxAOmaAli
 
Free Hibernate Tutorial | VirtualNuggets
Free Hibernate Tutorial  | VirtualNuggetsFree Hibernate Tutorial  | VirtualNuggets
Free Hibernate Tutorial | VirtualNuggetsVirtual Nuggets
 
Learning MVC Part 3 Creating MVC Application with EntityFramework
Learning MVC Part 3 Creating MVC Application with EntityFrameworkLearning MVC Part 3 Creating MVC Application with EntityFramework
Learning MVC Part 3 Creating MVC Application with EntityFrameworkAkhil Mittal
 
Multithreading and concurrency in android
Multithreading and concurrency in androidMultithreading and concurrency in android
Multithreading and concurrency in androidRakesh Jha
 
LINQ 2 SQL Presentation To Palmchip And Trg, Technology Resource Group
LINQ 2 SQL Presentation To Palmchip  And Trg, Technology Resource GroupLINQ 2 SQL Presentation To Palmchip  And Trg, Technology Resource Group
LINQ 2 SQL Presentation To Palmchip And Trg, Technology Resource GroupShahzad
 
DDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFrameworkDDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFrameworkbanq jdon
 

Similar to ADO.NET Database Apps Connected Disconnected XML (20)

ASP.NET Session 11 12
ASP.NET Session 11 12ASP.NET Session 11 12
ASP.NET Session 11 12
 
Ado.net
Ado.netAdo.net
Ado.net
 
Day4
Day4Day4
Day4
 
Ado.net & data persistence frameworks
Ado.net & data persistence frameworksAdo.net & data persistence frameworks
Ado.net & data persistence frameworks
 
6 database
6 database 6 database
6 database
 
Linq to xml
Linq to xmlLinq to xml
Linq to xml
 
Chap14 ado.net
Chap14 ado.netChap14 ado.net
Chap14 ado.net
 
LECTURE 14 Data Access.pptx
LECTURE 14 Data Access.pptxLECTURE 14 Data Access.pptx
LECTURE 14 Data Access.pptx
 
Free Hibernate Tutorial | VirtualNuggets
Free Hibernate Tutorial  | VirtualNuggetsFree Hibernate Tutorial  | VirtualNuggets
Free Hibernate Tutorial | VirtualNuggets
 
unit 3.docx
unit 3.docxunit 3.docx
unit 3.docx
 
Getting started with entity framework
Getting started with entity framework Getting started with entity framework
Getting started with entity framework
 
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
 
Learning MVC Part 3 Creating MVC Application with EntityFramework
Learning MVC Part 3 Creating MVC Application with EntityFrameworkLearning MVC Part 3 Creating MVC Application with EntityFramework
Learning MVC Part 3 Creating MVC Application with EntityFramework
 
Hibernate3 q&a
Hibernate3 q&aHibernate3 q&a
Hibernate3 q&a
 
Multithreading and concurrency in android
Multithreading and concurrency in androidMultithreading and concurrency in android
Multithreading and concurrency in android
 
LINQ 2 SQL Presentation To Palmchip And Trg, Technology Resource Group
LINQ 2 SQL Presentation To Palmchip  And Trg, Technology Resource GroupLINQ 2 SQL Presentation To Palmchip  And Trg, Technology Resource Group
LINQ 2 SQL Presentation To Palmchip And Trg, Technology Resource Group
 
Data access
Data accessData access
Data access
 
70487.pdf
70487.pdf70487.pdf
70487.pdf
 
Java solution
Java solutionJava solution
Java solution
 
DDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFrameworkDDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFramework
 

More from Niit Care (20)

Ajs 1 b
Ajs 1 bAjs 1 b
Ajs 1 b
 
Ajs 4 b
Ajs 4 bAjs 4 b
Ajs 4 b
 
Ajs 4 a
Ajs 4 aAjs 4 a
Ajs 4 a
 
Ajs 4 c
Ajs 4 cAjs 4 c
Ajs 4 c
 
Ajs 3 b
Ajs 3 bAjs 3 b
Ajs 3 b
 
Ajs 3 a
Ajs 3 aAjs 3 a
Ajs 3 a
 
Ajs 3 c
Ajs 3 cAjs 3 c
Ajs 3 c
 
Ajs 2 b
Ajs 2 bAjs 2 b
Ajs 2 b
 
Ajs 2 a
Ajs 2 aAjs 2 a
Ajs 2 a
 
Ajs 2 c
Ajs 2 cAjs 2 c
Ajs 2 c
 
Ajs 1 a
Ajs 1 aAjs 1 a
Ajs 1 a
 
Ajs 1 c
Ajs 1 cAjs 1 c
Ajs 1 c
 
Dacj 4 2-c
Dacj 4 2-cDacj 4 2-c
Dacj 4 2-c
 
Dacj 4 2-b
Dacj 4 2-bDacj 4 2-b
Dacj 4 2-b
 
Dacj 4 2-a
Dacj 4 2-aDacj 4 2-a
Dacj 4 2-a
 
Dacj 4 1-c
Dacj 4 1-cDacj 4 1-c
Dacj 4 1-c
 
Dacj 4 1-b
Dacj 4 1-bDacj 4 1-b
Dacj 4 1-b
 
Dacj 4 1-a
Dacj 4 1-aDacj 4 1-a
Dacj 4 1-a
 
Dacj 1-2 b
Dacj 1-2 bDacj 1-2 b
Dacj 1-2 b
 
Dacj 1-3 c
Dacj 1-3 cDacj 1-3 c
Dacj 1-3 c
 

Recently uploaded

Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 

Recently uploaded (20)

Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 

ADO.NET Database Apps Connected Disconnected XML

  • 1. Developing Database Applications Using ADO.NET and XML Objectives In this session, you will learn to: Identify the connected and disconnected environment in ADO.NET Working in a connected environment Ver. 1.0 Session 4 Slide 1 of 14
  • 2. Developing Database Applications Using ADO.NET and XML Introducing Connected and Disconnected Environment A connected environment is one in which a user or an application is constantly connected to a data source. A connected environment provides the following advantages: Data concurrency issues are easier to control. Data is current and updated. A connected environment has the following disadvantages: A constant network connection may, sometimes, lead to network traffic logging. Scalability and performance issues in applications. Let us now discuss the disconnected environment. Ver. 1.0 Session 4 Slide 2 of 14
  • 3. Developing Database Applications Using ADO.NET and XML Introducing Connected and Disconnected Environment (Contd.) In a disconnected environment is one in which a user or an application is not directly connected to a data source. A disconnected environment provides the following advantages: Allows multiple applications to simultaneously interact with the data source. Improves the scalability and performance of applications. A disconnected environment has the following disadvantages: Data is not always up to date as no proper connection is established with the data source. Data concurrency issues can occur when multiple users are updating the data to the data source. Ver. 1.0 Session 4 Slide 3 of 14
  • 4. Developing Database Applications Using ADO.NET and XML Introducing Connected and Disconnected Environment (Contd.) The following figure shows the connected and disconnected environment in ADO.NET. XML Data Source Ver. 1.0 Session 4 Slide 4 of 14
  • 5. Developing Database Applications Using ADO.NET and XML Working with Command Objects A Command object is a specific command that is used to manipulate data in a data source in a connected environment. A Command object represents a DML statement or a stored procedure that is used to retrieve, insert, delete, or modify data in a data source. The two types of operations performed by a command object to retrieve and modify data in a data source are: Synchronous operations Asynchronous operations Let us discuss these operations in detail. Ver. 1.0 Session 4 Slide 5 of 14
  • 6. Developing Database Applications Using ADO.NET and XML Working with Command Objects (Contd.) During synchronous operations, the command objects are linked to each other. Executing command objects synchronously results in a sequential execution, where each database command must complete before the next command is executed. Synchronous operations are performed with the help of the following command objects:  DbCommand object Executes a command in a data source against a valid open connection  DbParameters object Assigns parameterized values to stored procedures  DbDataReader object Retrieves a forward-only, read-only data from the data source Ver. 1.0 Session 4 Slide 6 of 14
  • 7. Developing Database Applications Using ADO.NET and XML Just a minute • Which method of the DbCommand object executes a DML statement against a connection and returns the number of rows affected? 1. ExecuteReader() 2. CreateObjRef() 3. ExecureNonQuery() 4. ExecuteScalar() Answer: 3. ExecuteNonQuery() Ver. 1.0 Session 4 Slide 7 of 14
  • 8. Developing Database Applications Using ADO.NET and XML Working with Command Objects (Contd.) • Asynchronous execution of commands enhances the overall performance and responsiveness of the client application. • ADO.NET supports asynchronous execution of commands to enable parallelism by allowing the client application to execute commands while waiting for the response from a previously issued command. • The asynchronous execution of commands is carried out in the SQLCommand class. Ver. 1.0 Session 4 Slide 8 of 14
  • 9. Developing Database Applications Using ADO.NET and XML Working with Command Objects (Contd.) • The SQLCommand class provides the following methods for asynchronous execution of commands:  BeginExecuteNonQuery() Starts the process of asynchronously executing a Transact-SQL statement or stored procedure that does not return rows  BeginExecuteReader() Starts the process of asynchronously executing a Transact-SQL statement or stored procedure that returns rows  BeginExecuteXmlReader() Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by the SqlCommand and returns the result as an XMLReader object Ver. 1.0 Session 4 Slide 9 of 14
  • 10. Developing Database Applications Using ADO.NET and XML Working with Command Objects (Contd.)  EndExecuteNonQuery() Completes the asynchronous execution of a Transact-SQL statement or stored procedure  EndExecuteReader() Completes the asynchronous execution of a Transact-SQL statement or a stored procedure, thereby, returning the requested SqlDataReader  EndExecuteXmlReader() Completes the asynchronous execution of a Transact-SQL statement or a stored procedure, thereby, returning XML data Ver. 1.0 Session 4 Slide 10 of 14
  • 11. Developing Database Applications Using ADO.NET and XML Working with Command Objects (Contd.) Another way of retrieving data asynchronously is by using Multiple Active Result Sets (MARS). MARS allows the execution of multiple data readers on a single connection. By default, MARS feature is disabled in an application. You can enable MARS in the connection string, as shown in the following code snippet: String connectionString = "Data Source=SQLSERVER01;Initial Catalog=AdventureWorks;User id=sa;Password=niit#1234; MultipleActiveResultSets=True"; Enabling MARS property to True Ver. 1.0 Session 4 Slide 11 of 14
  • 12. Developing Database Applications Using ADO.NET and XML Just a minute • What is the function of the EndExecuteReader() method of the SqlCommand class? 1. Asynchronously executes a stored procedure that returns rows 2. Executes the stored procedure and returns the result as an XmlReader object 3. Asynchronously executes a stored procedure that does not return rows 4. Executes the stored procedure and returns the result as an SqlDataReader object Answer: 4. Executes the stored procedure and returns the result as an SqlDataReader object Ver. 1.0 Session 4 Slide 12 of 14
  • 13. Developing Database Applications Using ADO.NET and XML Summary In this session, you learned that: A connected environment is one in which a user or an application is constantly connected to a data source. A disconnected environment is one in which a user or an application is not directly connected to a data source. The two types of operations performed by a command object to retrieve and modify data in a data source are:  Synchronous operations  Asynchronous operations  During synchronous operations, the command objects are linked to each other.  Synchronous operations are performed with the help of the following command objects:  DbCommand object  DbParameters object  DbDataReader object Ver. 1.0 Session 4 Slide 13 of 14
  • 14. Developing Database Applications Using ADO.NET and XML Summary (Contd.)  ADO.NET supports asynchronous execution of commands to enable parallelism by allowing the client application to execute commands while waiting for the response from a previously issued command.  The SqlCommand class provides the following methods for asynchronous operations:  BeginExecuteNonQuery()  BeginExecuteReader()  BeginExecuteXmlReader()  EndExecuteNonQuery()  EndExecuteReader()  EndExecuteXmlReader()  MARS allows the execution of multiple data readers on a single connection. Ver. 1.0 Session 4 Slide 14 of 14

Editor's Notes

  1. Introduce the students to the course by asking them what they know about forensics. Next, ask the students what they know about system forensics and why is it required in organizations dependent on IT. This could be a brief discussion of about 5 minutes. Lead the discussion to the objectives of this chapter.
  2. Introduce the students to the different types of threats that systems face by: Asking the students to give examples of what they think are environmental and human threats. Asking the students to give instances of what they think are malicious and non-malicious threats. Conclude the discussion on the different types of threats by giving additional examples of malicious and non malicious threats.
  3. Introduce the students to the different types of threats that systems face by: Asking the students to give examples of what they think are environmental and human threats. Asking the students to give instances of what they think are malicious and non-malicious threats. Conclude the discussion on the different types of threats by giving additional examples of malicious and non malicious threats.
  4. Introduce the students to the different types of threats that systems face by: Asking the students to give examples of what they think are environmental and human threats. Asking the students to give instances of what they think are malicious and non-malicious threats. Conclude the discussion on the different types of threats by giving additional examples of malicious and non malicious threats.
  5. Introduce the students to the different types of threats that systems face by: Asking the students to give examples of what they think are environmental and human threats. Asking the students to give instances of what they think are malicious and non-malicious threats. Conclude the discussion on the different types of threats by giving additional examples of malicious and non malicious threats.
  6. Introduce the students to the different types of threats that systems face by: Asking the students to give examples of what they think are environmental and human threats. Asking the students to give instances of what they think are malicious and non-malicious threats. Conclude the discussion on the different types of threats by giving additional examples of malicious and non malicious threats.
  7. In this slide you need to show the calculation to determine the sum of an arithmetic progression for bubble sort algorithm. Refer to student guide.
  8. Introduce the students to the different types of threats that systems face by: Asking the students to give examples of what they think are environmental and human threats. Asking the students to give instances of what they think are malicious and non-malicious threats. Conclude the discussion on the different types of threats by giving additional examples of malicious and non malicious threats.
  9. Introduce the students to the different types of threats that systems face by: Asking the students to give examples of what they think are environmental and human threats. Asking the students to give instances of what they think are malicious and non-malicious threats. Conclude the discussion on the different types of threats by giving additional examples of malicious and non malicious threats.
  10. Introduce the students to the different types of threats that systems face by: Asking the students to give examples of what they think are environmental and human threats. Asking the students to give instances of what they think are malicious and non-malicious threats. Conclude the discussion on the different types of threats by giving additional examples of malicious and non malicious threats.
  11. Introduce the students to the different types of threats that systems face by: Asking the students to give examples of what they think are environmental and human threats. Asking the students to give instances of what they think are malicious and non-malicious threats. Conclude the discussion on the different types of threats by giving additional examples of malicious and non malicious threats.
  12. In this slide you need to show the calculation to determine the sum of an arithmetic progression for bubble sort algorithm. Refer to student guide.