SlideShare a Scribd company logo
1 of 14
Download to read offline
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 session04

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 session04 (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

UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsSafe Software
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintMahmoud Rabie
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXTarek Kalaji
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDELiveplex
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfinfogdgmi
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdfPedro Manuel
 
IEEE Computer Society’s Strategic Activities and Products including SWEBOK Guide
IEEE Computer Society’s Strategic Activities and Products including SWEBOK GuideIEEE Computer Society’s Strategic Activities and Products including SWEBOK Guide
IEEE Computer Society’s Strategic Activities and Products including SWEBOK GuideHironori Washizaki
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaborationbruanjhuli
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioChristian Posta
 
100+ ChatGPT Prompts for SEO Optimization
100+ ChatGPT Prompts for SEO Optimization100+ ChatGPT Prompts for SEO Optimization
100+ ChatGPT Prompts for SEO Optimizationarrow10202532yuvraj
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Commit University
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAshyamraj55
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationIES VE
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfJamie (Taka) Wang
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Adtran
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesMd Hossain Ali
 
UiPath Studio Web workshop series - Day 5
UiPath Studio Web workshop series - Day 5UiPath Studio Web workshop series - Day 5
UiPath Studio Web workshop series - Day 5DianaGray10
 

Recently uploaded (20)

UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership Blueprint
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBX
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdf
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdf
 
IEEE Computer Society’s Strategic Activities and Products including SWEBOK Guide
IEEE Computer Society’s Strategic Activities and Products including SWEBOK GuideIEEE Computer Society’s Strategic Activities and Products including SWEBOK Guide
IEEE Computer Society’s Strategic Activities and Products including SWEBOK Guide
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and Istio
 
100+ ChatGPT Prompts for SEO Optimization
100+ ChatGPT Prompts for SEO Optimization100+ ChatGPT Prompts for SEO Optimization
100+ ChatGPT Prompts for SEO Optimization
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
 
201610817 - edge part1
201610817 - edge part1201610817 - edge part1
201610817 - edge part1
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
 
UiPath Studio Web workshop series - Day 5
UiPath Studio Web workshop series - Day 5UiPath Studio Web workshop series - Day 5
UiPath Studio Web workshop series - Day 5
 

Ado.net session04

  • 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.