SlideShare a Scribd company logo
1 of 24
Accessing and Manipulating Data


Pre-Assessment Questions
    1.   Which of the following is the fundamental format for data transfer in
         ADO.NET. ?
         •   HTML
         •   .doc
         •   .xls
         •   XML

    •    A data provider, which is used to work specifically with Microsoft SQL Server.
         a.   OLE DB data provider
         b.   SQL Server data provider
         c.   Oracle data provider
         d.   ODBC data provider




 ©NIIT          Creating Data Centric Applications using     Lesson 1B / Slide 1 of 24
                              ADO.NET
Accessing and Manipulating Data


Pre-Assessment Questions (Contd.)
    1.   Which of the following retrieves data from a database into a dataset?
         •   Data Adapter
         •   Data Reader
         •   Data Command
         •   Data Connection

    2.   Which of the following is not a component of DataTable?
         •   DataRowCollection
         •   DataView
         •   DataRelation
         •   DataColumnCollection




 ©NIIT          Creating Data Centric Applications using    Lesson 1B / Slide 2 of 24
                              ADO.NET
Accessing and Manipulating Data


Pre-Assessment Questions (Contd.)
    1.   Which of the following is used to navigate to the next row of data in case the
         command execution returns multiple rows of data?
         a.  Read method
         b.  Close method
         c.  Open method
         d.  NextResult method




 ©NIIT          Creating Data Centric Applications using     Lesson 1B / Slide 3 of 24
                              ADO.NET
Accessing and Manipulating Data


Objectives
    In this lesson, you will learn to:
         • Implement simple data binding
         • Implement complex data binding
         • Filter and sort Data




 ©NIIT         Creating Data Centric Applications using   Lesson 1B / Slide 4 of 24
                             ADO.NET
Accessing and Manipulating Data


Solutions to Pre-Assessment
Questions
         1.   d. XML
         2.   b. SQL Server data provider
         3.   a. Data Adapter
         4.   c. DataRelation
         5.   d. NextResult method




 ©NIIT        Creating Data Centric Applications using   Lesson 1B / Slide 5 of 24
                            ADO.NET
Accessing and Manipulating Data


Introducing Data Binding
    •    Data binding is binding data to a control on a Windows Form to be displayed in
         a customized format.
    •    Data binding is of two types :
           • Simple data binding
                • Simple data binding is process of binding a control, such as a text
                  box or a label, to a value in a dataset.
                • The dataset value can be bound to the control by using the properties
                  of the control.
           • Complex data binding
                • Complex binding is the process of binding a component, such as a
                  DataGrid or a ListBox control, to display multiple values for a
                  column from the dataset rows.




 ©NIIT            Creating Data Centric Applications using   Lesson 1B / Slide 6 of 24
                                ADO.NET
Accessing and Manipulating Data


Complex Data Binding Control
                    Control                            Description
         ListBox                   This control is used to display data for a column from
                                   multiple records of a dataset. The DataSource
                                   property of the ListBox control is used to set the
                                   dataset, and the DisplayMember property of the
                                   ListBox control is used to bind the control to a
                                   specific column of a table in the dataset.

         ComboBox                  This control has two parts, a text box for entering
                                   data and a drop-down list for displaying the data. The
                                   DataSource property of the ComboBox control is
                                   used to set the dataset, and the DisplayMember
                                   property of the ComboBox control is used to bind the
                                   control to a specific column of a table in the dataset.


         DataGrid                  This control can display data from multiple records as
                                   well as multiple columns. The DataSource property
                                   of the DataGrid control is used to set the dataset,
                                   and the DataMember property of the DataGrid
                                   control is used to bind the control to a specific table
                                   in the dataset.




 ©NIIT              Creating Data Centric Applications using                     Lesson 1B / Slide 7 of 24
                                  ADO.NET
Accessing and Manipulating Data


Navigating between Records
    •    For every data source that is bound to a Windows Form control, there
         exists a CurrencyManager object.
    •    The CurrencyManager object handles the binding to the data source by
         keeping a pointer to the current item in the record list.
    •    The CurrencyManager class is derived from the BindingManagerBase class.
    •    The figure given below illustrates the relationship between the
         BindingContext class, CurrencyManager class, and a Windows Form:
               Windows Form
                 Control 1
                 Control 2
                 Control 3


                                                 CurrencyManager 1                 DATA SOURCE 1


               BindingContext
                     object                      CurrencyManager 2                 DATA SOURCE 2



                                                 CurrencyManager 3                 DATA SOURCE 3


                       The BindingContext Class, CurrencyManager Class, and Windows Form

 ©NIIT          Creating Data Centric Applications using                               Lesson 1B / Slide 8 of 24
                              ADO.NET
Accessing and Manipulating Data




                Demo
   Implementing Simple Data Binding




 ©NIIT   Creating Data Centric Applications using   Lesson 1B / Slide 9 of 24
                       ADO.NET
Accessing and Manipulating Data

Problem Statement
    •    An application needs to be created that allows the Marketing Manager of Diaz
         Telecommunications to view customer details since the new product details are
         to be sent to all the customers. In addition, the Marketing Manager should be
         able to navigate through the customer details. The customer details are
         located in the database at a remote call center.




 ©NIIT           Creating Data Centric Applications using   Lesson 1B / Slide 10 of 24
                               ADO.NET
Accessing and Manipulating Data

Solution
    •    To design the application, you need to perform the following steps:
         1.   Design a Windows Form to display the data
         2.   Connect to the database
         3.   Write the code for navigating through the data
         4.   Bind the data to a Windows Form control




 ©NIIT          Creating Data Centric Applications using   Lesson 1B / Slide 11 of 24
                              ADO.NET
Accessing and Manipulating Data




               Demo
 Implementing Complex Data Binding




 ©NIIT   Creating Data Centric Applications using   Lesson 1B / Slide 12 of 24
                       ADO.NET
Accessing and Manipulating Data

Problem Statement
    •    An application needs to be created that allows the Marketing Manager of Diaz
         Telecommunications to view the customer details in a customized format
         since the new product details are to be sent to all the customers. The
         customer details are located in the database at a remote call center.




 ©NIIT          Creating Data Centric Applications using   Lesson 1B / Slide 13 of 24
                              ADO.NET
Accessing and Manipulating Data


Solution
    •    To design the application, you need to perform the following steps:
         1.   Design a Windows Form to display the data
         2.   Connect to the database
         3.   Bind the data to a Windows Form control




 ©NIIT          Creating Data Centric Applications using   Lesson 1B / Slide 14 of 24
                              ADO.NET
Accessing and Manipulating Data


Filtering and Sorting Data
    •    You filter the data so as to display only the desired records.
    •    You can sort the data to display it in ascending or descending order of a
         particular column.
    •    There are two methods for displaying filtered data:
         • Creating parameterized queries
         • Filtering a dataset




 ©NIIT          Creating Data Centric Applications using    Lesson 1B / Slide 15 of 24
                              ADO.NET
Accessing and Manipulating Data


Creating Parameterized Queries
    •    By using parameterized queries, data can be filtered based on the criterion
         entered by a user at run time.
    •    Parameterized queries are created while configuring data adapters.
    •    For example, when configuring an OLEDB data adapter through the wizard,
         you can specify the parameterized query for displaying data based on the
         value stored in the state column, as follows:
           SELECT id, lname, state
           FROM authordetails
           WHERE (state =?)
    •    For an SQL data adapter, the syntax for the above given parameterized
         query will be as follows:
           SELECT id, lname, state
           FROM authordetails
           WHERE (state =@param)


 ©NIIT         Creating Data Centric Applications using    Lesson 1B / Slide 16 of 24
                             ADO.NET
Accessing and Manipulating Data


Filtering a Dataset
    •    There are two options for filtering the data in a dataset:
         •    Using the Select() method
         •    Filtering a data view
    •    Using the Select() Method
         •    When the Select() method is used to filter data, the order of the
           records in the table does not change based on the parameter passed.
              Only the data is presented in a filtered format.
         •    To use the Select() method, an object of the DataTable class has to be
              created that will call the Select() method.




 ©NIIT          Creating Data Centric Applications using   Lesson 1B / Slide 17 of 24
                              ADO.NET
Accessing and Manipulating Data


Filtering a Data View
    •    A DataView object creates a fixed customized view of a given DataTable
         object.
    •    By default, every table in a dataset has a data view attached to it.
    •    You can also explicitly create the DataView objects in applications.
    •    You can bind the controls to the created data view for displaying data
         according to your needs.
    •    A parameterized class is a collection of classes that have common parameters
         and is represented by a template.
                                  FILTER2


                                                 DataView1
                    Windows                                                             Data Table
                    Application
                                                 DataView2


                                                 DataView3

                                  Filter1

                                       Displaying Customized Data Through Data Views

 ©NIIT           Creating Data Centric Applications using                              Lesson 1B / Slide 18 of 24
                               ADO.NET
Accessing and Manipulating Data


Filtering a Data View (Contd.)
    •    The generic steps to add a data view to a Windows Form are as follows:
         • Drag the DataView control from the Data tab of the Toolbox to the
              Windows Form.
         • Set the properties for the data view by using the Properties window. All
              the properties can be set at design time as well as at run time.
         • Data view is preferable since you can bind controls to the DataView
              object in the Form Designer.




 ©NIIT          Creating Data Centric Applications using   Lesson 1B / Slide 19 of 24
                              ADO.NET
Accessing and Manipulating Data




                Demo
   Implementing Filtering and Sorting
                Data




 ©NIIT   Creating Data Centric Applications using   Lesson 1B / Slide 20 of 24
                       ADO.NET
Accessing and Manipulating Data

Problem Statement
    •    An application needs to be created for the Marketing Manager of Diaz
         Telecommunications to view the order details for a specific invoice to verify
         the monthly sales report.




 ©NIIT          Creating Data Centric Applications using     Lesson 1B / Slide 21 of 24
                              ADO.NET
Accessing and Manipulating Data

Solution
    •    To design the application, you need to perform the following steps:
         1.   Design a Windows Form to display the data
         2.   Connect to the database, and filter and sort the data
         3.   Bind the data to a Windows Form control




 ©NIIT          Creating Data Centric Applications using   Lesson 1B / Slide 22 of 24
                              ADO.NET
Accessing and Manipulating Data


Summary
    In this lesson, you learned that:


    •    After the data is retrieved from the database, it has to be bound to a
         Windows Form control to be displayed in a customized format.
    •    Data binding is of two types:
         • Simple data binding
         • Complex data binding
    •    Using parameterized queries, the data can be filtered based on the criterion
         entered by a user.
    •    After the data is retrieved in a dataset, you can filter the data stored in the
         dataset by:
         • Using the Select() method
         • Using DataView objects
    •    A DataView object allows a fixed customized view of a given DataTable
         object.

 ©NIIT          Creating Data Centric Applications using     Lesson 1B / Slide 23 of 24
                              ADO.NET
Accessing and Manipulating Data


Summary (Contd.)
    •    A data view manager is a collection of data views and is useful while working
         with related tables.
    •    A CurrencyManager object handles the binding to the data source by keeping
         a pointer to the current item in the record list.
    •    A BindingContext object is used to keep track of the existing
         CurrencyManager objects on a form.




 ©NIIT          Creating Data Centric Applications using   Lesson 1B / Slide 24 of 24
                              ADO.NET

More Related Content

What's hot

What's hot (20)

Ado.net session02
Ado.net session02Ado.net session02
Ado.net session02
 
Ado.net session07
Ado.net session07Ado.net session07
Ado.net session07
 
Ado.net session04
Ado.net session04Ado.net session04
Ado.net session04
 
Ado.net session05
Ado.net session05Ado.net session05
Ado.net session05
 
Ado.net
Ado.netAdo.net
Ado.net
 
Entity Framework v1 and v2
Entity Framework v1 and v2Entity Framework v1 and v2
Entity Framework v1 and v2
 
Vb.net session 05
Vb.net session 05Vb.net session 05
Vb.net session 05
 
Visual Basic.Net & Ado.Net
Visual Basic.Net & Ado.NetVisual Basic.Net & Ado.Net
Visual Basic.Net & Ado.Net
 
Session 5 Tp5
Session 5 Tp5Session 5 Tp5
Session 5 Tp5
 
Easy Data Object Relational Mapping Tool
Easy Data Object Relational Mapping ToolEasy Data Object Relational Mapping Tool
Easy Data Object Relational Mapping Tool
 
AJP
AJPAJP
AJP
 
Introduction to OO, Java and Eclipse/WebSphere
Introduction to OO, Java and Eclipse/WebSphereIntroduction to OO, Java and Eclipse/WebSphere
Introduction to OO, Java and Eclipse/WebSphere
 
ASP.NET 09 - ADO.NET
ASP.NET 09 - ADO.NETASP.NET 09 - ADO.NET
ASP.NET 09 - ADO.NET
 
Hibernate
HibernateHibernate
Hibernate
 
Programming with Objective-C
Programming with Objective-CProgramming with Objective-C
Programming with Objective-C
 
Ado.net
Ado.netAdo.net
Ado.net
 
Jpa
JpaJpa
Jpa
 
ORM Concepts and JPA 2.0 Specifications
ORM Concepts and JPA 2.0 SpecificationsORM Concepts and JPA 2.0 Specifications
ORM Concepts and JPA 2.0 Specifications
 
Java beans
Java beansJava beans
Java beans
 
Connected data classes
Connected data classesConnected data classes
Connected data classes
 

Viewers also liked

Moneycation march 2015 newsletter; volume #3, issue #7
Moneycation march 2015 newsletter; volume #3, issue #7Moneycation march 2015 newsletter; volume #3, issue #7
Moneycation march 2015 newsletter; volume #3, issue #7A.W. Berry
 
Managing education costs
Managing education costsManaging education costs
Managing education costsA.W. Berry
 
Contrato super gas bras
Contrato super gas brasContrato super gas bras
Contrato super gas brasportaldorio
 
Time Value of Money
Time Value of MoneyTime Value of Money
Time Value of MoneyMikee Bylss
 
Sample California revocable living trust with spendthrift provision
Sample California revocable living trust with spendthrift provisionSample California revocable living trust with spendthrift provision
Sample California revocable living trust with spendthrift provisionLegalDocsPro
 
Chapter 16 Working Capital
Chapter 16 Working CapitalChapter 16 Working Capital
Chapter 16 Working CapitalMikee Bylss
 
Risk and Returns
Risk and ReturnsRisk and Returns
Risk and ReturnsMikee Bylss
 
5 Things You Need To Ask Your Media Agency
5 Things You Need To Ask Your Media Agency5 Things You Need To Ask Your Media Agency
5 Things You Need To Ask Your Media AgencyMichelle Norris
 
Air conditioning market
Air conditioning marketAir conditioning market
Air conditioning marketTushar Gupta
 
GITMAN Chapter 2 Financial Statement Analysis
GITMAN Chapter 2 Financial Statement AnalysisGITMAN Chapter 2 Financial Statement Analysis
GITMAN Chapter 2 Financial Statement AnalysisMikee Bylss
 
Chapter 17, lesson 2 emancipation proclamation for website
Chapter 17, lesson 2   emancipation proclamation for websiteChapter 17, lesson 2   emancipation proclamation for website
Chapter 17, lesson 2 emancipation proclamation for websiteDavid Poss
 

Viewers also liked (14)

CORAL Fact Sheet
CORAL Fact SheetCORAL Fact Sheet
CORAL Fact Sheet
 
Analysis of CYNX Stock
Analysis of CYNX StockAnalysis of CYNX Stock
Analysis of CYNX Stock
 
Moneycation march 2015 newsletter; volume #3, issue #7
Moneycation march 2015 newsletter; volume #3, issue #7Moneycation march 2015 newsletter; volume #3, issue #7
Moneycation march 2015 newsletter; volume #3, issue #7
 
Managing education costs
Managing education costsManaging education costs
Managing education costs
 
DEBER UTPL
DEBER UTPLDEBER UTPL
DEBER UTPL
 
Contrato super gas bras
Contrato super gas brasContrato super gas bras
Contrato super gas bras
 
Time Value of Money
Time Value of MoneyTime Value of Money
Time Value of Money
 
Sample California revocable living trust with spendthrift provision
Sample California revocable living trust with spendthrift provisionSample California revocable living trust with spendthrift provision
Sample California revocable living trust with spendthrift provision
 
Chapter 16 Working Capital
Chapter 16 Working CapitalChapter 16 Working Capital
Chapter 16 Working Capital
 
Risk and Returns
Risk and ReturnsRisk and Returns
Risk and Returns
 
5 Things You Need To Ask Your Media Agency
5 Things You Need To Ask Your Media Agency5 Things You Need To Ask Your Media Agency
5 Things You Need To Ask Your Media Agency
 
Air conditioning market
Air conditioning marketAir conditioning market
Air conditioning market
 
GITMAN Chapter 2 Financial Statement Analysis
GITMAN Chapter 2 Financial Statement AnalysisGITMAN Chapter 2 Financial Statement Analysis
GITMAN Chapter 2 Financial Statement Analysis
 
Chapter 17, lesson 2 emancipation proclamation for website
Chapter 17, lesson 2   emancipation proclamation for websiteChapter 17, lesson 2   emancipation proclamation for website
Chapter 17, lesson 2 emancipation proclamation for website
 

Similar to Vb.net session 06

Vb.net session 07
Vb.net session 07Vb.net session 07
Vb.net session 07Niit Care
 
Vb net xp_06
Vb net xp_06Vb net xp_06
Vb net xp_06Niit Care
 
Ado.net session01
Ado.net session01Ado.net session01
Ado.net session01Niit Care
 
Databind in asp.net
Databind in asp.netDatabind in asp.net
Databind in asp.netSireesh K
 
Advance Webpage Devlopment .NET
Advance Webpage Devlopment .NETAdvance Webpage Devlopment .NET
Advance Webpage Devlopment .NETPandeyABHISHEK1
 
C# Tutorial MSM_Murach chapter-17-slides
C# Tutorial MSM_Murach chapter-17-slidesC# Tutorial MSM_Murach chapter-17-slides
C# Tutorial MSM_Murach chapter-17-slidesSami Mut
 
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
 
Vb net xp_07
Vb net xp_07Vb net xp_07
Vb net xp_07Niit Care
 
1585625790_SQL-SESSION1.pptx
1585625790_SQL-SESSION1.pptx1585625790_SQL-SESSION1.pptx
1585625790_SQL-SESSION1.pptxMullaMainuddin
 
Asp.net Lab manual
Asp.net Lab manualAsp.net Lab manual
Asp.net Lab manualTamil Dhasan
 
VISUAL BASIC .net data accesss vii
VISUAL BASIC .net data accesss viiVISUAL BASIC .net data accesss vii
VISUAL BASIC .net data accesss viiargusacademy
 
Bridging the Last Mile: Getting Data to the People Who Need It (APAC)
Bridging the Last Mile: Getting Data to the People Who Need It (APAC)Bridging the Last Mile: Getting Data to the People Who Need It (APAC)
Bridging the Last Mile: Getting Data to the People Who Need It (APAC)Denodo
 
DEE 431 Introduction to DBMS Slide 1
DEE 431 Introduction to DBMS Slide 1DEE 431 Introduction to DBMS Slide 1
DEE 431 Introduction to DBMS Slide 1YOGESH SINGH
 
WEB PROGRAMMING USING ASP.NET
WEB PROGRAMMING USING ASP.NETWEB PROGRAMMING USING ASP.NET
WEB PROGRAMMING USING ASP.NETDhruvVekariya3
 
Technical Demonstration - Denodo Platform 7.0
Technical Demonstration - Denodo Platform 7.0Technical Demonstration - Denodo Platform 7.0
Technical Demonstration - Denodo Platform 7.0Denodo
 

Similar to Vb.net session 06 (20)

Vb.net session 07
Vb.net session 07Vb.net session 07
Vb.net session 07
 
Vb net xp_06
Vb net xp_06Vb net xp_06
Vb net xp_06
 
Ado.net session01
Ado.net session01Ado.net session01
Ado.net session01
 
Databind in asp.net
Databind in asp.netDatabind in asp.net
Databind in asp.net
 
Advance Webpage Devlopment .NET
Advance Webpage Devlopment .NETAdvance Webpage Devlopment .NET
Advance Webpage Devlopment .NET
 
Ado .net
Ado .netAdo .net
Ado .net
 
ASP.NET Lecture 4
ASP.NET Lecture 4ASP.NET Lecture 4
ASP.NET Lecture 4
 
C# Tutorial MSM_Murach chapter-17-slides
C# Tutorial MSM_Murach chapter-17-slidesC# Tutorial MSM_Murach chapter-17-slides
C# Tutorial MSM_Murach chapter-17-slides
 
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
 
DBMS.pptx
DBMS.pptxDBMS.pptx
DBMS.pptx
 
data binding.docx
data binding.docxdata binding.docx
data binding.docx
 
Vb net xp_07
Vb net xp_07Vb net xp_07
Vb net xp_07
 
1585625790_SQL-SESSION1.pptx
1585625790_SQL-SESSION1.pptx1585625790_SQL-SESSION1.pptx
1585625790_SQL-SESSION1.pptx
 
Asp.net Lab manual
Asp.net Lab manualAsp.net Lab manual
Asp.net Lab manual
 
Crystal report
Crystal reportCrystal report
Crystal report
 
VISUAL BASIC .net data accesss vii
VISUAL BASIC .net data accesss viiVISUAL BASIC .net data accesss vii
VISUAL BASIC .net data accesss vii
 
Bridging the Last Mile: Getting Data to the People Who Need It (APAC)
Bridging the Last Mile: Getting Data to the People Who Need It (APAC)Bridging the Last Mile: Getting Data to the People Who Need It (APAC)
Bridging the Last Mile: Getting Data to the People Who Need It (APAC)
 
DEE 431 Introduction to DBMS Slide 1
DEE 431 Introduction to DBMS Slide 1DEE 431 Introduction to DBMS Slide 1
DEE 431 Introduction to DBMS Slide 1
 
WEB PROGRAMMING USING ASP.NET
WEB PROGRAMMING USING ASP.NETWEB PROGRAMMING USING ASP.NET
WEB PROGRAMMING USING ASP.NET
 
Technical Demonstration - Denodo Platform 7.0
Technical Demonstration - Denodo Platform 7.0Technical Demonstration - Denodo Platform 7.0
Technical Demonstration - Denodo Platform 7.0
 

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-a
Dacj 4 2-aDacj 4 2-a
Dacj 4 2-a
 
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
 
Dacj 1-3 b
Dacj 1-3 bDacj 1-3 b
Dacj 1-3 b
 
Dacj 1-3 a
Dacj 1-3 aDacj 1-3 a
Dacj 1-3 a
 
Dacj 1-2 c
Dacj 1-2 cDacj 1-2 c
Dacj 1-2 c
 
Dacj 1-2 a
Dacj 1-2 aDacj 1-2 a
Dacj 1-2 a
 

Recently uploaded

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 

Recently uploaded (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

Vb.net session 06

  • 1. Accessing and Manipulating Data Pre-Assessment Questions 1. Which of the following is the fundamental format for data transfer in ADO.NET. ? • HTML • .doc • .xls • XML • A data provider, which is used to work specifically with Microsoft SQL Server. a. OLE DB data provider b. SQL Server data provider c. Oracle data provider d. ODBC data provider ©NIIT Creating Data Centric Applications using Lesson 1B / Slide 1 of 24 ADO.NET
  • 2. Accessing and Manipulating Data Pre-Assessment Questions (Contd.) 1. Which of the following retrieves data from a database into a dataset? • Data Adapter • Data Reader • Data Command • Data Connection 2. Which of the following is not a component of DataTable? • DataRowCollection • DataView • DataRelation • DataColumnCollection ©NIIT Creating Data Centric Applications using Lesson 1B / Slide 2 of 24 ADO.NET
  • 3. Accessing and Manipulating Data Pre-Assessment Questions (Contd.) 1. Which of the following is used to navigate to the next row of data in case the command execution returns multiple rows of data? a. Read method b. Close method c. Open method d. NextResult method ©NIIT Creating Data Centric Applications using Lesson 1B / Slide 3 of 24 ADO.NET
  • 4. Accessing and Manipulating Data Objectives In this lesson, you will learn to: • Implement simple data binding • Implement complex data binding • Filter and sort Data ©NIIT Creating Data Centric Applications using Lesson 1B / Slide 4 of 24 ADO.NET
  • 5. Accessing and Manipulating Data Solutions to Pre-Assessment Questions 1. d. XML 2. b. SQL Server data provider 3. a. Data Adapter 4. c. DataRelation 5. d. NextResult method ©NIIT Creating Data Centric Applications using Lesson 1B / Slide 5 of 24 ADO.NET
  • 6. Accessing and Manipulating Data Introducing Data Binding • Data binding is binding data to a control on a Windows Form to be displayed in a customized format. • Data binding is of two types : • Simple data binding • Simple data binding is process of binding a control, such as a text box or a label, to a value in a dataset. • The dataset value can be bound to the control by using the properties of the control. • Complex data binding • Complex binding is the process of binding a component, such as a DataGrid or a ListBox control, to display multiple values for a column from the dataset rows. ©NIIT Creating Data Centric Applications using Lesson 1B / Slide 6 of 24 ADO.NET
  • 7. Accessing and Manipulating Data Complex Data Binding Control Control Description ListBox This control is used to display data for a column from multiple records of a dataset. The DataSource property of the ListBox control is used to set the dataset, and the DisplayMember property of the ListBox control is used to bind the control to a specific column of a table in the dataset. ComboBox This control has two parts, a text box for entering data and a drop-down list for displaying the data. The DataSource property of the ComboBox control is used to set the dataset, and the DisplayMember property of the ComboBox control is used to bind the control to a specific column of a table in the dataset. DataGrid This control can display data from multiple records as well as multiple columns. The DataSource property of the DataGrid control is used to set the dataset, and the DataMember property of the DataGrid control is used to bind the control to a specific table in the dataset. ©NIIT Creating Data Centric Applications using Lesson 1B / Slide 7 of 24 ADO.NET
  • 8. Accessing and Manipulating Data Navigating between Records • For every data source that is bound to a Windows Form control, there exists a CurrencyManager object. • The CurrencyManager object handles the binding to the data source by keeping a pointer to the current item in the record list. • The CurrencyManager class is derived from the BindingManagerBase class. • The figure given below illustrates the relationship between the BindingContext class, CurrencyManager class, and a Windows Form: Windows Form Control 1 Control 2 Control 3 CurrencyManager 1 DATA SOURCE 1 BindingContext object CurrencyManager 2 DATA SOURCE 2 CurrencyManager 3 DATA SOURCE 3 The BindingContext Class, CurrencyManager Class, and Windows Form ©NIIT Creating Data Centric Applications using Lesson 1B / Slide 8 of 24 ADO.NET
  • 9. Accessing and Manipulating Data Demo Implementing Simple Data Binding ©NIIT Creating Data Centric Applications using Lesson 1B / Slide 9 of 24 ADO.NET
  • 10. Accessing and Manipulating Data Problem Statement • An application needs to be created that allows the Marketing Manager of Diaz Telecommunications to view customer details since the new product details are to be sent to all the customers. In addition, the Marketing Manager should be able to navigate through the customer details. The customer details are located in the database at a remote call center. ©NIIT Creating Data Centric Applications using Lesson 1B / Slide 10 of 24 ADO.NET
  • 11. Accessing and Manipulating Data Solution • To design the application, you need to perform the following steps: 1. Design a Windows Form to display the data 2. Connect to the database 3. Write the code for navigating through the data 4. Bind the data to a Windows Form control ©NIIT Creating Data Centric Applications using Lesson 1B / Slide 11 of 24 ADO.NET
  • 12. Accessing and Manipulating Data Demo Implementing Complex Data Binding ©NIIT Creating Data Centric Applications using Lesson 1B / Slide 12 of 24 ADO.NET
  • 13. Accessing and Manipulating Data Problem Statement • An application needs to be created that allows the Marketing Manager of Diaz Telecommunications to view the customer details in a customized format since the new product details are to be sent to all the customers. The customer details are located in the database at a remote call center. ©NIIT Creating Data Centric Applications using Lesson 1B / Slide 13 of 24 ADO.NET
  • 14. Accessing and Manipulating Data Solution • To design the application, you need to perform the following steps: 1. Design a Windows Form to display the data 2. Connect to the database 3. Bind the data to a Windows Form control ©NIIT Creating Data Centric Applications using Lesson 1B / Slide 14 of 24 ADO.NET
  • 15. Accessing and Manipulating Data Filtering and Sorting Data • You filter the data so as to display only the desired records. • You can sort the data to display it in ascending or descending order of a particular column. • There are two methods for displaying filtered data: • Creating parameterized queries • Filtering a dataset ©NIIT Creating Data Centric Applications using Lesson 1B / Slide 15 of 24 ADO.NET
  • 16. Accessing and Manipulating Data Creating Parameterized Queries • By using parameterized queries, data can be filtered based on the criterion entered by a user at run time. • Parameterized queries are created while configuring data adapters. • For example, when configuring an OLEDB data adapter through the wizard, you can specify the parameterized query for displaying data based on the value stored in the state column, as follows: SELECT id, lname, state FROM authordetails WHERE (state =?) • For an SQL data adapter, the syntax for the above given parameterized query will be as follows: SELECT id, lname, state FROM authordetails WHERE (state =@param) ©NIIT Creating Data Centric Applications using Lesson 1B / Slide 16 of 24 ADO.NET
  • 17. Accessing and Manipulating Data Filtering a Dataset • There are two options for filtering the data in a dataset: • Using the Select() method • Filtering a data view • Using the Select() Method • When the Select() method is used to filter data, the order of the records in the table does not change based on the parameter passed. Only the data is presented in a filtered format. • To use the Select() method, an object of the DataTable class has to be created that will call the Select() method. ©NIIT Creating Data Centric Applications using Lesson 1B / Slide 17 of 24 ADO.NET
  • 18. Accessing and Manipulating Data Filtering a Data View • A DataView object creates a fixed customized view of a given DataTable object. • By default, every table in a dataset has a data view attached to it. • You can also explicitly create the DataView objects in applications. • You can bind the controls to the created data view for displaying data according to your needs. • A parameterized class is a collection of classes that have common parameters and is represented by a template. FILTER2 DataView1 Windows Data Table Application DataView2 DataView3 Filter1 Displaying Customized Data Through Data Views ©NIIT Creating Data Centric Applications using Lesson 1B / Slide 18 of 24 ADO.NET
  • 19. Accessing and Manipulating Data Filtering a Data View (Contd.) • The generic steps to add a data view to a Windows Form are as follows: • Drag the DataView control from the Data tab of the Toolbox to the Windows Form. • Set the properties for the data view by using the Properties window. All the properties can be set at design time as well as at run time. • Data view is preferable since you can bind controls to the DataView object in the Form Designer. ©NIIT Creating Data Centric Applications using Lesson 1B / Slide 19 of 24 ADO.NET
  • 20. Accessing and Manipulating Data Demo Implementing Filtering and Sorting Data ©NIIT Creating Data Centric Applications using Lesson 1B / Slide 20 of 24 ADO.NET
  • 21. Accessing and Manipulating Data Problem Statement • An application needs to be created for the Marketing Manager of Diaz Telecommunications to view the order details for a specific invoice to verify the monthly sales report. ©NIIT Creating Data Centric Applications using Lesson 1B / Slide 21 of 24 ADO.NET
  • 22. Accessing and Manipulating Data Solution • To design the application, you need to perform the following steps: 1. Design a Windows Form to display the data 2. Connect to the database, and filter and sort the data 3. Bind the data to a Windows Form control ©NIIT Creating Data Centric Applications using Lesson 1B / Slide 22 of 24 ADO.NET
  • 23. Accessing and Manipulating Data Summary In this lesson, you learned that: • After the data is retrieved from the database, it has to be bound to a Windows Form control to be displayed in a customized format. • Data binding is of two types: • Simple data binding • Complex data binding • Using parameterized queries, the data can be filtered based on the criterion entered by a user. • After the data is retrieved in a dataset, you can filter the data stored in the dataset by: • Using the Select() method • Using DataView objects • A DataView object allows a fixed customized view of a given DataTable object. ©NIIT Creating Data Centric Applications using Lesson 1B / Slide 23 of 24 ADO.NET
  • 24. Accessing and Manipulating Data Summary (Contd.) • A data view manager is a collection of data views and is useful while working with related tables. • A CurrencyManager object handles the binding to the data source by keeping a pointer to the current item in the record list. • A BindingContext object is used to keep track of the existing CurrencyManager objects on a form. ©NIIT Creating Data Centric Applications using Lesson 1B / Slide 24 of 24 ADO.NET