SlideShare una empresa de Scribd logo
1 de 18
Working with ADO.NET


Objectives
    In this lesson, you will learn to:
         • Identify the features of ADO.NET
         • Identify the components of the ADO.NET object model
         • Connect to a database by creating a data adapter
         • Access a database through a dataset
         • Preview the data adapter result




 ©NIIT           Creating Data Centric Applications using   Lesson 1A / Slide 1 of 18
                              ADO.NET
Working with ADO.NET


An Introduction to ADO.NET
    •    Applications need to communicate with a database for the following tasks:
           • Retrieving the data stored in the database and presenting it in a user-
             friendly format
           • Updating the database, that is, inserting, modifying, and deleting data
    •    ADO.NET is a model used by .NET applications to communicate with a
         database for retrieving, accessing, and updating data.




 ©NIIT              Creating Data Centric Applications using   Lesson 1A / Slide 2 of 18
                                 ADO.NET
Working with ADO.NET


Features of ADO.NET
    •    Disconnected data architecture :
           • Applications connect to the database only while retrieving and updating
             data.
           • A database can cater to the needs of several applications simultaneously
             since the interaction is for a shorter duration.
    •    Data cached in datasets :
           • A dataset is the most common method of accessing data in ADO.NET.
           • A dataset is a cached set of database records.
           • A dataset is independent of data source and you remain disconnected from
             the data source.
    •    Scalability
           • Database operations are performed on the dataset instead of on the
             database, therefore, database can meet the increasing demands of users
             more efficiently.


 ©NIIT             Creating Data Centric Applications using   Lesson 1A / Slide 3 of 18
                                ADO.NET
Working with ADO.NET


Features of ADO.NET (Contd.)
    •    Data transfer in XML format
           • Data is transferred from a database into a dataset and from the dataset to
             another component by using XML.
           • You can transmit a dataset between different types of applications that
             support XML.
    •    Interaction with the database is done through data commands:
           • A DataCommand object can be used for accessing or updating the data
             using either a SQL statement or a stored procedure.
           • You can retrieve, insert, delete, or modify data from a database by
             executing data commands.




 ©NIIT              Creating Data Centric Applications using   Lesson 1A / Slide 4 of 18
                                 ADO.NET
Working with ADO.NET


The ADO.NET Object Model
    •    The structured process flow or the object model is shown in the following
         figure:
                                                     DATA PROVIDER
                                                                               Establishes
                                                                           connection with the
                                                                                database
                                                     CONNECTION
                                                                      Retrieves data in a
             VISUAL BASIC              Accessing                        read-only, forward
                  .NET           retrieved data                             only mode
              APPLICATION                            DATA READER
                                                                      Executes a command to       DATABASE
            (WINDOWS/ WEB
                                                                      retrieve data from the
                 FORM)
                                                                      database
                                                        COMMAND
                                                                       Transfers data to the
                                                                        dataset and reflects
                Accessing retrieved data                               the changes made in
                                                                         the dataset to the
                         Filling dataset with data                           database
             DATASET                                 DATA ADAPTER



                                                The ADO.NET Object Model




 ©NIIT                 Creating Data Centric Applications using                                  Lesson 1A / Slide 5 of 18
                                    ADO.NET
Working with ADO.NET


The ADO.NET Object Model (Contd.)
    •    The data residing in a database is retrieved through data provider.
    •    An application can access data either through a dataset or through a
         DataReader object:
           • Using a dataset: The data is cached in a dataset and the application
             accesses the data from the dataset.
           • Using a data reader: A DataReader object, which is a component of the
             data provider, uses the Connection object to connect to the database.
    •    The key components of the ADO.NET are as follows:
           • Data Provider
           • Dataset




 ©NIIT             Creating Data Centric Applications using   Lesson 1A / Slide 6 of 18
                                ADO.NET
Working with ADO.NET


Data Provider
    • A data provider is used for connecting to a database, retrieving data, storing
      the data in a dataset, reading the retrieved data, and updating the database.
    • There are two types of data providers:
        • OLE DB data provider : Works with all the OLE DB providers, such as SQL
          OLE DB provider, Oracle OLE DB provider, and Jet OLE DB provider.
        • SQL Server data provider : Is used to work specifically with Microsoft SQL
          Server.
    Connection
    • Used to establish a connection with a data source
    • Two of the most common Connection objects used are OleDbConnection and
      SqlConnection.




 ©NIIT            Creating Data Centric Applications using   Lesson 1A / Slide 7 of 18
                               ADO.NET
Working with ADO.NET


Data Adapter
    •    Data is transferred to and from a database through a data adapter.
    •    The changes in the database are actually done by the data adapter.
    •    You access data from a database by configuring a data adapter.
    •    Two widely used data adapter are:
           • SqlDataAdapter : Configured to access data specifically from Microsoft SQL
             Server
           • OleDbDataAdapter : Configured to access data from any database that is
             supported by an OLE DB data provider




 ©NIIT              Creating Data Centric Applications using   Lesson 1A / Slide 8 of 18
                                 ADO.NET
Working with ADO.NET


Data Adapter (Contd.)
    Properties and Methods
    • SelectCommand : Refers to a SQL statement or a stored procedure to retrieve
       data from the database
    • InsertCommand : Refers to a data command to insert data into a database
    • UpdateCommand : Refers to a data command to update a database
    • DeleteCommand : Refers to a data command to delete data from a database
    • Fill() Method : Fills the dataset with the records from a database
    • Update() Method : Executes the corresponding InsertCommand,
       UpdateCommand, or DeleteCommand
    Creating a data adapter
    • There are three methods to create a data adapter:
         • Through a wizard
         • Using the Server Explorer window
         • Programmatically


 ©NIIT           Creating Data Centric Applications using   Lesson 1A / Slide 9 of 18
                              ADO.NET
Working with ADO.NET


Data Command and Data Reader
    Data Command
    • An object representing a SQL statement or a stored procedure that is used to
       retrieve, insert, delete, or modify data in a data source
    • Derived from the OleDbCommand class
    Data Reader
    • Used to retrieve data from a data source in a read-only and forward-only mode
    • A data reader uses :
         • Connection object to connect to the database
         • Command object to execute SQL statements or procedures




 ©NIIT           Creating Data Centric Applications using   Lesson 1A / Slide 10 of 18
                              ADO.NET
Working with ADO.NET


Dataset
    •    Dataset is a disconnected, cached set of records that are retrieved from a
         database
    •    dataset object model
                                                   DATASET




               dataRelationCollection      dataTableCollection         extendedproperties




                   DataRelation
                                              DataTable




                dataRowCollection       dataview          primarykey       dataColumnCollection




                   DataRow                                                      DataColumn

                                         The Dataset Object Model




 ©NIIT                 Creating Data Centric Applications using                     Lesson 1A / Slide 11 of 18
                                    ADO.NET
Working with ADO.NET


Dataset ( Contd.)
    Types of Dataset
    • Two types of datasets :
        • Typed : Has an associated XML schema. XML Schema Definition (XSD)
           language is used to define the elements and attributes of XML
           documents.
        • Untyped : Does not have any associated XML schema. The tables and
           columns are represented as collections.




 ©NIIT           Creating Data Centric Applications using   Lesson 1A / Slide 12 of 18
                              ADO.NET
Working with ADO.NET




                  Demo
         Connecting to a Database




 ©NIIT     Creating Data Centric Applications using   Lesson 1A / Slide 13 of 18
                        ADO.NET
Working with ADO.NET


Problem Statement
    •    The call center application needs to provide the facility of viewing the customer
         details for the Sales department.
           • Create an application to display the customer details for the Sales
             department.




 ©NIIT              Creating Data Centric Applications using   Lesson 1A / Slide 14 of 18
                                 ADO.NET
Working with ADO.NET


Solution
    •    To design the application, you need to perform the following steps:
         1.   Create a data adapter.
         2.   Create a data set.
         3.   Preview the database records.




 ©NIIT            Creating Data Centric Applications using   Lesson 1A / Slide 15 of 18
                               ADO.NET
Working with ADO.NET


Summary
    In this lesson, you learned that:


    •    ADO.NET is a data access programming model for accessing the data stored
         in a database from a .NET application.
    •    The main features of ADO.NET:
         • Disconnected data architecture
         • Data cached in datasets
         • Data transfer in XML format
         • Interaction with the database through data commands
    •    The ADO.NET object model consists of Dataset, Data Provider, and Database.




 ©NIIT            Creating Data Centric Applications using   Lesson 1A / Slide 16 of 18
                               ADO.NET
Working with ADO.NET


Summary (Contd.)
    •    Data provider is used for connecting to a database, retrieving data, storing
         the data in a dataset, reading the retrieved data, and updating the database.
         Types of data provider are:
         • SQL Data Provider
         • OLE DB Data Provider
         • Oracle Data Provider
         • ODBC Data Provider
    •    Connection object is used to establish a connection with a data source.
    •    Data adapter is used to transfer data to and from a database. Two types of
         Data adapters are:
         • SqlDataAdapter
         • OleDbDataAdapter



 ©NIIT            Creating Data Centric Applications using   Lesson 1A / Slide 17 of 18
                               ADO.NET
Working with ADO.NET


Summary (Contd.)
    •    Three methods of creating Data adapter are:
         • Through a wizard
         • Using the Server Explorer window
         • Programmatically
    •    Data command is a object representing a SQL statement or a stored
         procedure that is used to retrieve, insert, delete, or modify data in a data
         source.
    •    Data reader is used to retrieve data from a data source in a read-only and
         forward-only mode.
    •    Data is retrieved through datasets. Datasets are of two types i.e. Typed and
         Untyped.
         • Typed datasets — A typed dataset is derived from the base DataSet
              class and has an associated XML schema.
         • Untyped datasets — An untyped dataset does not have any associated
              XML schema. The tables and columns in an untyped dataset are
              represented as collections.
 ©NIIT            Creating Data Centric Applications using   Lesson 1A / Slide 18 of 18
                               ADO.NET

Más contenido relacionado

La actualidad más candente (20)

Ado.net
Ado.netAdo.net
Ado.net
 
ADO .Net
ADO .Net ADO .Net
ADO .Net
 
Ado.net
Ado.netAdo.net
Ado.net
 
Ado.net
Ado.netAdo.net
Ado.net
 
Ado .net
Ado .netAdo .net
Ado .net
 
For Beginners - Ado.net
For Beginners - Ado.netFor Beginners - Ado.net
For Beginners - Ado.net
 
ADO.NET -database connection
ADO.NET -database connectionADO.NET -database connection
ADO.NET -database connection
 
ADO.NET
ADO.NETADO.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
 
Ado.net
Ado.netAdo.net
Ado.net
 
Database programming in vb net
Database programming in vb netDatabase programming in vb net
Database programming in vb net
 
ASP.NET 09 - ADO.NET
ASP.NET 09 - ADO.NETASP.NET 09 - ADO.NET
ASP.NET 09 - ADO.NET
 
Ado.net
Ado.netAdo.net
Ado.net
 
Ado.net session05
Ado.net session05Ado.net session05
Ado.net session05
 
Introduction to ado
Introduction to adoIntroduction to ado
Introduction to ado
 
Ado.net session01
Ado.net session01Ado.net session01
Ado.net session01
 
ado.net
ado.netado.net
ado.net
 
Ado.net session04
Ado.net session04Ado.net session04
Ado.net session04
 
For Beginers - ADO.Net
For Beginers - ADO.NetFor Beginers - ADO.Net
For Beginers - ADO.Net
 
Ado.net session02
Ado.net session02Ado.net session02
Ado.net session02
 

Destacado

Ch06 ado.net fundamentals
Ch06 ado.net fundamentalsCh06 ado.net fundamentals
Ch06 ado.net fundamentalsMadhuri Kavade
 
Vb net xp_05
Vb net xp_05Vb net xp_05
Vb net xp_05Niit Care
 
Vb net xp_11
Vb net xp_11Vb net xp_11
Vb net xp_11Niit Care
 
Ch 04 asp.net application
Ch 04 asp.net application Ch 04 asp.net application
Ch 04 asp.net application Madhuri Kavade
 
Asp.NET Validation controls
Asp.NET Validation controlsAsp.NET Validation controls
Asp.NET Validation controlsGuddu gupta
 
Introduction to asp.net
Introduction to asp.netIntroduction to asp.net
Introduction to asp.netshan km
 
The complete ASP.NET (IIS) Tutorial with code example in power point slide show
The complete ASP.NET (IIS) Tutorial with code example in power point slide showThe complete ASP.NET (IIS) Tutorial with code example in power point slide show
The complete ASP.NET (IIS) Tutorial with code example in power point slide showSubhas Malik
 
Be project ppt asp.net
Be project ppt asp.netBe project ppt asp.net
Be project ppt asp.netSanket Jagare
 
Validation controls ppt
Validation controls pptValidation controls ppt
Validation controls pptIblesoft
 
Validation controls in asp
Validation controls in aspValidation controls in asp
Validation controls in aspShishir Jain
 
Asp.net architecture
Asp.net architectureAsp.net architecture
Asp.net architectureIblesoft
 
structured and unstructured interview
structured and unstructured interviewstructured and unstructured interview
structured and unstructured interviewahsan mubeen
 
Developing an aspnet web application
Developing an aspnet web applicationDeveloping an aspnet web application
Developing an aspnet web applicationRahul Bansal
 
Developing an ASP.NET Web Application
Developing an ASP.NET Web ApplicationDeveloping an ASP.NET Web Application
Developing an ASP.NET Web ApplicationRishi Kothari
 

Destacado (19)

Ch06 ado.net fundamentals
Ch06 ado.net fundamentalsCh06 ado.net fundamentals
Ch06 ado.net fundamentals
 
Vb net xp_05
Vb net xp_05Vb net xp_05
Vb net xp_05
 
Vb net xp_11
Vb net xp_11Vb net xp_11
Vb net xp_11
 
Ch 04 asp.net application
Ch 04 asp.net application Ch 04 asp.net application
Ch 04 asp.net application
 
Asp.NET Validation controls
Asp.NET Validation controlsAsp.NET Validation controls
Asp.NET Validation controls
 
Introduction to asp.net
Introduction to asp.netIntroduction to asp.net
Introduction to asp.net
 
Asp dot net final (2)
Asp dot net   final (2)Asp dot net   final (2)
Asp dot net final (2)
 
Debugging
DebuggingDebugging
Debugging
 
The complete ASP.NET (IIS) Tutorial with code example in power point slide show
The complete ASP.NET (IIS) Tutorial with code example in power point slide showThe complete ASP.NET (IIS) Tutorial with code example in power point slide show
The complete ASP.NET (IIS) Tutorial with code example in power point slide show
 
ASP.NET Web form
ASP.NET Web formASP.NET Web form
ASP.NET Web form
 
Be project ppt asp.net
Be project ppt asp.netBe project ppt asp.net
Be project ppt asp.net
 
Validation controls ppt
Validation controls pptValidation controls ppt
Validation controls ppt
 
IPSec and VPN
IPSec and VPNIPSec and VPN
IPSec and VPN
 
Validation controls in asp
Validation controls in aspValidation controls in asp
Validation controls in asp
 
Asp.net architecture
Asp.net architectureAsp.net architecture
Asp.net architecture
 
structured and unstructured interview
structured and unstructured interviewstructured and unstructured interview
structured and unstructured interview
 
Structured Interviews
Structured InterviewsStructured Interviews
Structured Interviews
 
Developing an aspnet web application
Developing an aspnet web applicationDeveloping an aspnet web application
Developing an aspnet web application
 
Developing an ASP.NET Web Application
Developing an ASP.NET Web ApplicationDeveloping an ASP.NET Web Application
Developing an ASP.NET Web Application
 

Similar a Vb.net session 05

Vb.net session 06
Vb.net session 06Vb.net session 06
Vb.net session 06Niit Care
 
Vb.net session 16
Vb.net session 16Vb.net session 16
Vb.net session 16Niit Care
 
WEB PROGRAMMING USING ASP.NET
WEB PROGRAMMING USING ASP.NETWEB PROGRAMMING USING ASP.NET
WEB PROGRAMMING USING ASP.NETDhruvVekariya3
 
Latest Advance Animated Ado.Net With JDBC
Latest Advance Animated Ado.Net With JDBC Latest Advance Animated Ado.Net With JDBC
Latest Advance Animated Ado.Net With JDBC Tarun Jain
 
Mobile Offline First for inclusive data that spans the data divide
Mobile Offline First for inclusive data that spans the data divideMobile Offline First for inclusive data that spans the data divide
Mobile Offline First for inclusive data that spans the data divideRob Worthington
 
Is2215 lecture7 lecturer_ado_intro
Is2215 lecture7 lecturer_ado_introIs2215 lecture7 lecturer_ado_intro
Is2215 lecture7 lecturer_ado_introdannygriff1
 
Databind in asp.net
Databind in asp.netDatabind in asp.net
Databind in asp.netSireesh K
 
ADO .NET by Sonu Vishwakarma
ADO .NET by Sonu VishwakarmaADO .NET by Sonu Vishwakarma
ADO .NET by Sonu VishwakarmaSonu Vishwakarma
 
1-introduction to DB.pdf
1-introduction to DB.pdf1-introduction to DB.pdf
1-introduction to DB.pdfMuniraALmogren
 
Building N Tier Applications With Entity Framework Services 2010
Building N Tier Applications With Entity Framework Services 2010Building N Tier Applications With Entity Framework Services 2010
Building N Tier Applications With Entity Framework Services 2010David McCarter
 
Marmagna desai
Marmagna desaiMarmagna desai
Marmagna desaijmsthakur
 
History of database processing module 1 (2)
History of database processing module 1 (2)History of database processing module 1 (2)
History of database processing module 1 (2)chottu89
 
DataBase Management systems (IM).pptx
DataBase Management systems (IM).pptxDataBase Management systems (IM).pptx
DataBase Management systems (IM).pptxGooglePay16
 

Similar a Vb.net session 05 (20)

Vb.net session 06
Vb.net session 06Vb.net session 06
Vb.net session 06
 
Vb.net session 16
Vb.net session 16Vb.net session 16
Vb.net session 16
 
WEB PROGRAMMING USING ASP.NET
WEB PROGRAMMING USING ASP.NETWEB PROGRAMMING USING ASP.NET
WEB PROGRAMMING USING ASP.NET
 
Ado
AdoAdo
Ado
 
Latest Advance Animated Ado.Net With JDBC
Latest Advance Animated Ado.Net With JDBC Latest Advance Animated Ado.Net With JDBC
Latest Advance Animated Ado.Net With JDBC
 
Mobile Offline First for inclusive data that spans the data divide
Mobile Offline First for inclusive data that spans the data divideMobile Offline First for inclusive data that spans the data divide
Mobile Offline First for inclusive data that spans the data divide
 
ADO.net control
ADO.net controlADO.net control
ADO.net control
 
Ado
AdoAdo
Ado
 
Is2215 lecture7 lecturer_ado_intro
Is2215 lecture7 lecturer_ado_introIs2215 lecture7 lecturer_ado_intro
Is2215 lecture7 lecturer_ado_intro
 
Introduction to ado.net
Introduction to ado.netIntroduction to ado.net
Introduction to ado.net
 
Databind in asp.net
Databind in asp.netDatabind in asp.net
Databind in asp.net
 
ADO .NET by Sonu Vishwakarma
ADO .NET by Sonu VishwakarmaADO .NET by Sonu Vishwakarma
ADO .NET by Sonu Vishwakarma
 
1-introduction to DB.pdf
1-introduction to DB.pdf1-introduction to DB.pdf
1-introduction to DB.pdf
 
Ado Net
Ado NetAdo Net
Ado Net
 
Building N Tier Applications With Entity Framework Services 2010
Building N Tier Applications With Entity Framework Services 2010Building N Tier Applications With Entity Framework Services 2010
Building N Tier Applications With Entity Framework Services 2010
 
Marmagna desai
Marmagna desaiMarmagna desai
Marmagna desai
 
6 database
6 database 6 database
6 database
 
History of database processing module 1 (2)
History of database processing module 1 (2)History of database processing module 1 (2)
History of database processing module 1 (2)
 
DataBase Management systems (IM).pptx
DataBase Management systems (IM).pptxDataBase Management systems (IM).pptx
DataBase Management systems (IM).pptx
 
ADO.NET Introduction
ADO.NET IntroductionADO.NET Introduction
ADO.NET Introduction
 

Más de 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
 

Último

The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
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
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
"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
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
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
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 

Último (20)

The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
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
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
"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
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
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!
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 

Vb.net session 05

  • 1. Working with ADO.NET Objectives In this lesson, you will learn to: • Identify the features of ADO.NET • Identify the components of the ADO.NET object model • Connect to a database by creating a data adapter • Access a database through a dataset • Preview the data adapter result ©NIIT Creating Data Centric Applications using Lesson 1A / Slide 1 of 18 ADO.NET
  • 2. Working with ADO.NET An Introduction to ADO.NET • Applications need to communicate with a database for the following tasks: • Retrieving the data stored in the database and presenting it in a user- friendly format • Updating the database, that is, inserting, modifying, and deleting data • ADO.NET is a model used by .NET applications to communicate with a database for retrieving, accessing, and updating data. ©NIIT Creating Data Centric Applications using Lesson 1A / Slide 2 of 18 ADO.NET
  • 3. Working with ADO.NET Features of ADO.NET • Disconnected data architecture : • Applications connect to the database only while retrieving and updating data. • A database can cater to the needs of several applications simultaneously since the interaction is for a shorter duration. • Data cached in datasets : • A dataset is the most common method of accessing data in ADO.NET. • A dataset is a cached set of database records. • A dataset is independent of data source and you remain disconnected from the data source. • Scalability • Database operations are performed on the dataset instead of on the database, therefore, database can meet the increasing demands of users more efficiently. ©NIIT Creating Data Centric Applications using Lesson 1A / Slide 3 of 18 ADO.NET
  • 4. Working with ADO.NET Features of ADO.NET (Contd.) • Data transfer in XML format • Data is transferred from a database into a dataset and from the dataset to another component by using XML. • You can transmit a dataset between different types of applications that support XML. • Interaction with the database is done through data commands: • A DataCommand object can be used for accessing or updating the data using either a SQL statement or a stored procedure. • You can retrieve, insert, delete, or modify data from a database by executing data commands. ©NIIT Creating Data Centric Applications using Lesson 1A / Slide 4 of 18 ADO.NET
  • 5. Working with ADO.NET The ADO.NET Object Model • The structured process flow or the object model is shown in the following figure: DATA PROVIDER Establishes connection with the database CONNECTION Retrieves data in a VISUAL BASIC Accessing read-only, forward .NET retrieved data only mode APPLICATION DATA READER Executes a command to DATABASE (WINDOWS/ WEB retrieve data from the FORM) database COMMAND Transfers data to the dataset and reflects Accessing retrieved data the changes made in the dataset to the Filling dataset with data database DATASET DATA ADAPTER The ADO.NET Object Model ©NIIT Creating Data Centric Applications using Lesson 1A / Slide 5 of 18 ADO.NET
  • 6. Working with ADO.NET The ADO.NET Object Model (Contd.) • The data residing in a database is retrieved through data provider. • An application can access data either through a dataset or through a DataReader object: • Using a dataset: The data is cached in a dataset and the application accesses the data from the dataset. • Using a data reader: A DataReader object, which is a component of the data provider, uses the Connection object to connect to the database. • The key components of the ADO.NET are as follows: • Data Provider • Dataset ©NIIT Creating Data Centric Applications using Lesson 1A / Slide 6 of 18 ADO.NET
  • 7. Working with ADO.NET Data Provider • A data provider is used for connecting to a database, retrieving data, storing the data in a dataset, reading the retrieved data, and updating the database. • There are two types of data providers: • OLE DB data provider : Works with all the OLE DB providers, such as SQL OLE DB provider, Oracle OLE DB provider, and Jet OLE DB provider. • SQL Server data provider : Is used to work specifically with Microsoft SQL Server. Connection • Used to establish a connection with a data source • Two of the most common Connection objects used are OleDbConnection and SqlConnection. ©NIIT Creating Data Centric Applications using Lesson 1A / Slide 7 of 18 ADO.NET
  • 8. Working with ADO.NET Data Adapter • Data is transferred to and from a database through a data adapter. • The changes in the database are actually done by the data adapter. • You access data from a database by configuring a data adapter. • Two widely used data adapter are: • SqlDataAdapter : Configured to access data specifically from Microsoft SQL Server • OleDbDataAdapter : Configured to access data from any database that is supported by an OLE DB data provider ©NIIT Creating Data Centric Applications using Lesson 1A / Slide 8 of 18 ADO.NET
  • 9. Working with ADO.NET Data Adapter (Contd.) Properties and Methods • SelectCommand : Refers to a SQL statement or a stored procedure to retrieve data from the database • InsertCommand : Refers to a data command to insert data into a database • UpdateCommand : Refers to a data command to update a database • DeleteCommand : Refers to a data command to delete data from a database • Fill() Method : Fills the dataset with the records from a database • Update() Method : Executes the corresponding InsertCommand, UpdateCommand, or DeleteCommand Creating a data adapter • There are three methods to create a data adapter: • Through a wizard • Using the Server Explorer window • Programmatically ©NIIT Creating Data Centric Applications using Lesson 1A / Slide 9 of 18 ADO.NET
  • 10. Working with ADO.NET Data Command and Data Reader Data Command • An object representing a SQL statement or a stored procedure that is used to retrieve, insert, delete, or modify data in a data source • Derived from the OleDbCommand class Data Reader • Used to retrieve data from a data source in a read-only and forward-only mode • A data reader uses : • Connection object to connect to the database • Command object to execute SQL statements or procedures ©NIIT Creating Data Centric Applications using Lesson 1A / Slide 10 of 18 ADO.NET
  • 11. Working with ADO.NET Dataset • Dataset is a disconnected, cached set of records that are retrieved from a database • dataset object model DATASET dataRelationCollection dataTableCollection extendedproperties DataRelation DataTable dataRowCollection dataview primarykey dataColumnCollection DataRow DataColumn The Dataset Object Model ©NIIT Creating Data Centric Applications using Lesson 1A / Slide 11 of 18 ADO.NET
  • 12. Working with ADO.NET Dataset ( Contd.) Types of Dataset • Two types of datasets : • Typed : Has an associated XML schema. XML Schema Definition (XSD) language is used to define the elements and attributes of XML documents. • Untyped : Does not have any associated XML schema. The tables and columns are represented as collections. ©NIIT Creating Data Centric Applications using Lesson 1A / Slide 12 of 18 ADO.NET
  • 13. Working with ADO.NET Demo Connecting to a Database ©NIIT Creating Data Centric Applications using Lesson 1A / Slide 13 of 18 ADO.NET
  • 14. Working with ADO.NET Problem Statement • The call center application needs to provide the facility of viewing the customer details for the Sales department. • Create an application to display the customer details for the Sales department. ©NIIT Creating Data Centric Applications using Lesson 1A / Slide 14 of 18 ADO.NET
  • 15. Working with ADO.NET Solution • To design the application, you need to perform the following steps: 1. Create a data adapter. 2. Create a data set. 3. Preview the database records. ©NIIT Creating Data Centric Applications using Lesson 1A / Slide 15 of 18 ADO.NET
  • 16. Working with ADO.NET Summary In this lesson, you learned that: • ADO.NET is a data access programming model for accessing the data stored in a database from a .NET application. • The main features of ADO.NET: • Disconnected data architecture • Data cached in datasets • Data transfer in XML format • Interaction with the database through data commands • The ADO.NET object model consists of Dataset, Data Provider, and Database. ©NIIT Creating Data Centric Applications using Lesson 1A / Slide 16 of 18 ADO.NET
  • 17. Working with ADO.NET Summary (Contd.) • Data provider is used for connecting to a database, retrieving data, storing the data in a dataset, reading the retrieved data, and updating the database. Types of data provider are: • SQL Data Provider • OLE DB Data Provider • Oracle Data Provider • ODBC Data Provider • Connection object is used to establish a connection with a data source. • Data adapter is used to transfer data to and from a database. Two types of Data adapters are: • SqlDataAdapter • OleDbDataAdapter ©NIIT Creating Data Centric Applications using Lesson 1A / Slide 17 of 18 ADO.NET
  • 18. Working with ADO.NET Summary (Contd.) • Three methods of creating Data adapter are: • Through a wizard • Using the Server Explorer window • Programmatically • Data command is a object representing a SQL statement or a stored procedure that is used to retrieve, insert, delete, or modify data in a data source. • Data reader is used to retrieve data from a data source in a read-only and forward-only mode. • Data is retrieved through datasets. Datasets are of two types i.e. Typed and Untyped. • Typed datasets — A typed dataset is derived from the base DataSet class and has an associated XML schema. • Untyped datasets — An untyped dataset does not have any associated XML schema. The tables and columns in an untyped dataset are represented as collections. ©NIIT Creating Data Centric Applications using Lesson 1A / Slide 18 of 18 ADO.NET