SlideShare une entreprise Scribd logo
1  sur  33
Accessing and Manipulating Data

Objectives
In this lesson, you will learn to:
 Bind and display data in a Windows Form
 Filter data
 Sort data
 Display data from multiple tables in a single Windows Form




   ©NIIT                 Accessing and Manipulating Data/Lesson 6/Slide 1 of 33
Accessing and Manipulating Data

Problem Statement 6.D.1
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               Accessing and Manipulating Data/Lesson 6/Slide 2 of 33
Accessing and Manipulating Data

Task List
Identify the data that needs to be displayed.
Identify the mechanism to display data in a customized
format.
Design a Windows Form to display the data.
Connect to the database.
Bind the data to a Windows Form control.
View the data.




   ©NIIT               Accessing and Manipulating Data/Lesson 6/Slide 3 of 33
Accessing and Manipulating Data

Task 1: Identify the data that needs to be displayed.
Result:
As per the given problem statement, the data to be
displayed is as follows:
     CustID
     FName
     LName
     Address
     Phone
     email


   ©NIIT              Accessing and Manipulating Data/Lesson 6/Slide 4 of 33
Accessing and Manipulating Data

Task 2: Identify the mechanism to display data in a
customized format.
Data binding is the process of binding the retrieved data to a
      control on a Windows Form to be displayed in a
customized format.
Data binding is of two types:
    Simple Data Binding
    Complex Data Binding
Result:
For the given problem statement, you will use complex data
      binding to display the data.


   ©NIIT               Accessing and Manipulating Data/Lesson 6/Slide 5 of 33
Accessing and Manipulating Data

Just a Minute…
What is the difference between simple data binding and
complex data binding? What are the controls used in each
type of binding?




   ©NIIT              Accessing and Manipulating Data/Lesson 6/Slide 6 of 33
Accessing and Manipulating Data

Task 3: Design a Windows Form to display the data.
Task 4: Connect to the database.
Task 5: Bind the data to a Windows Form control.
Task 6: View the data.




  ©NIIT            Accessing and Manipulating Data/Lesson 6/Slide 7 of 33
Accessing and Manipulating Data

Problem Statement 6.D.2
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               Accessing and Manipulating Data/Lesson 6/Slide 8 of 33
Accessing and Manipulating Data

Task List
Identify the data that needs to be displayed.
Identify the mechanism to display data in a customized
format.
Identify the mechanism to navigate through the data.
Design a Windows Form to display the data.
Connect to the database.
Write the code to navigate through the data.
Bind the data to a Windows Form control.
View the data.


   ©NIIT               Accessing and Manipulating Data/Lesson 6/Slide 9 of 33
Accessing and Manipulating Data

Task 1: Identify the data that needs to be displayed.
Result:
As per the given problem statement, the data to be
displayed is as follows:
     CustID
     Fname
     Lname
     Address
     Phone
     email


   ©NIIT             Accessing and Manipulating Data/Lesson 6/Slide 10 of 33
Accessing and Manipulating Data

Task 2: Identify the mechanism to data in a
customized format.
Result:
For the given problem statement, you will use simple data
      binding to bind and display the data.




   ©NIIT             Accessing and Manipulating Data/Lesson 6/Slide 11 of 33
Accessing and Manipulating Data

Task 3: Identify the mechanism to navigate through
the data.
The CurrencyManager class
    Exists for every data source that is bound to a Windows
     Form.
    Object handles the binding to the data source by
     keeping a pointer to the current item in the record list.
    Is derived from the BindingManagerBase class.
A BindingContext object, which is a Windows Form
object, is used to keep track of the existing
CurrencyManager objects in a form.



  ©NIIT               Accessing and Manipulating Data/Lesson 6/Slide 12 of 33
Accessing and Manipulating Data

Task 3: Identify the mechanism to navigate through
the data. (Contd.)
Relationship between the BindingContext class,
CurrencyManager class, and Windows Form:
          Windows Form
          Control 1
          Control 2
          Control 3
                                  CurrencyManager 1          DATA SOURCE 1

          BindingContext
                                  CurrencyManager 1          DATA SOURCE 1
                object

                                  CurrencyManager 1          DATA SOURCE 1




  ©NIIT                    Accessing and Manipulating Data/Lesson 6/Slide 13 of 33
Accessing and Manipulating Data

Task 3: Identify the mechanism to navigate through
the data. (Contd.)
Result:
You will use the BindingManagerBase class and the
BindingContext() method to navigate through the
records.
Task 4: Design a Windows Form to display the data.
Task 5: Connect to the database.
Task 6: Write the code to navigate through the data.
Task 7: Bind the data to a Windows Form control.
Task 8: View the data.
   ©NIIT           Accessing and Manipulating Data/Lesson 6/Slide 14 of 33
Accessing and Manipulating Data

Problem Statement 6.D.3
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             Accessing and Manipulating Data/Lesson 6/Slide 15 of 33
Accessing and Manipulating Data

Task List
Identify the data that needs to be displayed.
Identify the method to filter and sort the data.
Identify the method to navigate through the data.
Design a Windows Form to display the data.
Connect to the database, and filter and sort the data.
Bind the data to a Windows Form control.
View the data.




   ©NIIT               Accessing and Manipulating Data/Lesson 6/Slide 16 of 33
Accessing and Manipulating Data

Task 1: Identify the data that needs to be displayed.
Result:
As per the given problem statement, the data to be
displayed is as follows:
    Inv
    Date
    CustID
    ProdID
    Cost
    Advance


   ©NIIT             Accessing and Manipulating Data/Lesson 6/Slide 17 of 33
Accessing and Manipulating Data

Task 2: Identify the method to filter and sort the data.
There are two methods to display filtered data:
    Parameterized queries
           ®Filter data based on the criterion entered by a user
            at run time.
           ®Are created while configuring data adapters.
    Filtering a dataset
           ®After the data is retrieved in a dataset, the data can
            be filtered by:
              ® Using   the Select() method
              ® Filtering   a data view

   ©NIIT                    Accessing and Manipulating Data/Lesson 6/Slide 18 of 33
Accessing and Manipulating Data

Task 2: Identify the method to filter and sort the data.
(Contd.)
The Select() method
    Used to filter data without changing the order of the
     records in the table based on the parameter passed.




  ©NIIT              Accessing and Manipulating Data/Lesson 6/Slide 19 of 33
Accessing and Manipulating Data

Just a Minute…
The records of customers having monthly income of $4200
needs to be displayed in ascending order of their names from
the table Employees. Write the code to retrieve filtered records
and store the retrieved records.




   ©NIIT              Accessing and Manipulating Data/Lesson 6/Slide 20 of 33
Accessing and Manipulating Data

Task 2: Identify the method to filter and sort the data.
(Contd.)
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.
    Multiple DataView objects can also be explicitly
     created for displaying different views of the same
     underlying data.




   ©NIIT                 Accessing and Manipulating Data/Lesson 6/Slide 21 of 33
Accessing and Manipulating Data

Task 2: Identify the method to filter and sort the data.
(Contd.)
    Some commonly used properties of the DataView
     object:
          ®Table
          ®Sort
          ®RowFilter
          ®RowStateFilter
          ®AllowNew, AllowDelete, AllowEdit




  ©NIIT                Accessing and Manipulating Data/Lesson 6/Slide 22 of 33
Accessing and Manipulating Data

Task 2: Identify the method to filter and sort the data.
(Contd.)
Result:
You will use a parameterized query to filter and sort the
data, as it requires you to write minimum code.




   ©NIIT              Accessing and Manipulating Data/Lesson 6/Slide 23 of 33
Accessing and Manipulating Data

Just a Minute…
The name, date of joining, and department of the employees
with salary greater than $2000 need to be retrieved and
displayed in a DataGrid control. Write the code to filter the
data and display the filtered data.




   ©NIIT              Accessing and Manipulating Data/Lesson 6/Slide 24 of 33
Accessing and Manipulating Data

Task 3: Identify the method to navigate through the
data.
Result:
You will use the BindingManagerBase class and the
BindingContext() method to navigate through the data.
Task 4: Design a Windows Form to display the data.
Task 5: Connect to the database, and filter and sort
the data.
Task 6: Bind the data to a Windows Form control.
Task 7: View the data.


   ©NIIT            Accessing and Manipulating Data/Lesson 6/Slide 25 of 33
Accessing and Manipulating Data

Problem Statement 6.D.4
An application needs to be created for the Diaz
Telecommunications Marketing Manager to view customer
details, such as the name and address, and order details for a
specific customer for analyzing customer feedbacks. The
customer details and the order details are present in separate
tables.




   ©NIIT              Accessing and Manipulating Data/Lesson 6/Slide 26 of 33
Accessing and Manipulating Data

Task List
Identify the data that needs to be displayed.
Identify the mechanism to display data from multiple tables
      in a single Windows Form.
Design a Windows Form to display the data.
Connect to the database.
Create a relationship between the tables.
Bind the data to the Windows Form controls.
View the data from multiple tables in a single Windows
Form.


   ©NIIT              Accessing and Manipulating Data/Lesson 6/Slide 27 of 33
Accessing and Manipulating Data

Task 1: Identify the data that needs to be displayed.
Result:
As per the given problem statement, the data to be
displayed is as follows:
     FName
     Address
     ProdID
     Inv
     Date
     CustID


   ©NIIT             Accessing and Manipulating Data/Lesson 6/Slide 28 of 33
Accessing and Manipulating Data

Task 2: Identify the mechanism to display data from
multiple tables in a single Windows Form.
Tables are stored in a dataset as discrete entities but a
relationship can be created between the stored tables to
display data from the related tables.
The column that is common in both the tables is used to
create the relationship.
Result:
You will create a relationship between CustomerTracking
     and CustOrder tables to display the data from both the
     tables.



   ©NIIT              Accessing and Manipulating Data/Lesson 6/Slide 29 of 33
Accessing and Manipulating Data

Task 3: Design a Windows Form to display the data.
Task 4: Connect to the database.
Task 5: Create a relationship between the tables.
Task 6: Bind the data to the Windows Form controls.
Task 7: View the data.




  ©NIIT            Accessing and Manipulating Data/Lesson 6/Slide 30 of 33
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.



   ©NIIT               Accessing and Manipulating Data/Lesson 6/Slide 31 of 33
Accessing and Manipulating Data

Summary (Contd.)
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.
A data view manager is a collection of data views
and is useful while working with related tables.




   ©NIIT               Accessing and Manipulating Data/Lesson 6/Slide 32 of 33
Accessing and Manipulating Data

Summary (Contd.)
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.
Tables are stored in a dataset as discrete entities, but a
relationship can be created between the stored tables so
that the dataset displays data from the related tables.




   ©NIIT              Accessing and Manipulating Data/Lesson 6/Slide 33 of 33

Contenu connexe

Similaire à Vb net xp_06

Vb net xp_08
Vb net xp_08Vb net xp_08
Vb net xp_08Niit Care
 
Vb net xp_07
Vb net xp_07Vb net xp_07
Vb net xp_07Niit Care
 
Vb net xp_05
Vb net xp_05Vb net xp_05
Vb net xp_05Niit Care
 
Data Warehousing
Data WarehousingData Warehousing
Data Warehousingamooool2000
 
Vb.net session 07
Vb.net session 07Vb.net session 07
Vb.net session 07Niit Care
 
DATA CAPTURING TRAINING_FINAL.pptx
DATA CAPTURING TRAINING_FINAL.pptxDATA CAPTURING TRAINING_FINAL.pptx
DATA CAPTURING TRAINING_FINAL.pptxscokoye
 
IRJET- Analysis of Big Data Technology and its Challenges
IRJET- Analysis of Big Data Technology and its ChallengesIRJET- Analysis of Big Data Technology and its Challenges
IRJET- Analysis of Big Data Technology and its ChallengesIRJET Journal
 
Smart Health Guide App
Smart Health Guide AppSmart Health Guide App
Smart Health Guide AppIRJET Journal
 
How to collect and organize data
How to collect and organize dataHow to collect and organize data
How to collect and organize dataFrieda Brioschi
 
Ado.net session02
Ado.net session02Ado.net session02
Ado.net session02Niit Care
 
An analysis and impact factors on Agriculture field using Data Mining Techniques
An analysis and impact factors on Agriculture field using Data Mining TechniquesAn analysis and impact factors on Agriculture field using Data Mining Techniques
An analysis and impact factors on Agriculture field using Data Mining Techniquesijcnes
 
Data Mining - Presentation.pptx
Data Mining - Presentation.pptxData Mining - Presentation.pptx
Data Mining - Presentation.pptxfahadusman23
 
Database Systems
Database SystemsDatabase Systems
Database SystemsUsman Tariq
 
208-dataflowdgm_5.ppt
208-dataflowdgm_5.ppt208-dataflowdgm_5.ppt
208-dataflowdgm_5.pptTalhaNazeer5
 

Similaire à Vb net xp_06 (20)

data binding.docx
data binding.docxdata binding.docx
data binding.docx
 
Vb net xp_08
Vb net xp_08Vb net xp_08
Vb net xp_08
 
Vb net xp_07
Vb net xp_07Vb net xp_07
Vb net xp_07
 
Vb net xp_05
Vb net xp_05Vb net xp_05
Vb net xp_05
 
Data Warehousing
Data WarehousingData Warehousing
Data Warehousing
 
Vb.net session 07
Vb.net session 07Vb.net session 07
Vb.net session 07
 
DATA CAPTURING TRAINING_FINAL.pptx
DATA CAPTURING TRAINING_FINAL.pptxDATA CAPTURING TRAINING_FINAL.pptx
DATA CAPTURING TRAINING_FINAL.pptx
 
Grid view control
Grid view controlGrid view control
Grid view control
 
IRJET- Analysis of Big Data Technology and its Challenges
IRJET- Analysis of Big Data Technology and its ChallengesIRJET- Analysis of Big Data Technology and its Challenges
IRJET- Analysis of Big Data Technology and its Challenges
 
Smart Health Guide App
Smart Health Guide AppSmart Health Guide App
Smart Health Guide App
 
How to collect and organize data
How to collect and organize dataHow to collect and organize data
How to collect and organize data
 
Seminar Report Vaibhav
Seminar Report VaibhavSeminar Report Vaibhav
Seminar Report Vaibhav
 
Ado.net session02
Ado.net session02Ado.net session02
Ado.net session02
 
An analysis and impact factors on Agriculture field using Data Mining Techniques
An analysis and impact factors on Agriculture field using Data Mining TechniquesAn analysis and impact factors on Agriculture field using Data Mining Techniques
An analysis and impact factors on Agriculture field using Data Mining Techniques
 
Automated Document Indexing with ImageRamp
Automated Document Indexing with ImageRampAutomated Document Indexing with ImageRamp
Automated Document Indexing with ImageRamp
 
Data Mining - Presentation.pptx
Data Mining - Presentation.pptxData Mining - Presentation.pptx
Data Mining - Presentation.pptx
 
Database Systems
Database SystemsDatabase Systems
Database Systems
 
Sql xp 05
Sql xp 05Sql xp 05
Sql xp 05
 
Unit 5
Unit 5 Unit 5
Unit 5
 
208-dataflowdgm_5.ppt
208-dataflowdgm_5.ppt208-dataflowdgm_5.ppt
208-dataflowdgm_5.ppt
 

Plus 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 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
 
Dacj 1-3 b
Dacj 1-3 bDacj 1-3 b
Dacj 1-3 b
 

Dernier

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 

Dernier (20)

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 

Vb net xp_06

  • 1. Accessing and Manipulating Data Objectives In this lesson, you will learn to: Bind and display data in a Windows Form Filter data Sort data Display data from multiple tables in a single Windows Form ©NIIT Accessing and Manipulating Data/Lesson 6/Slide 1 of 33
  • 2. Accessing and Manipulating Data Problem Statement 6.D.1 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 Accessing and Manipulating Data/Lesson 6/Slide 2 of 33
  • 3. Accessing and Manipulating Data Task List Identify the data that needs to be displayed. Identify the mechanism to display data in a customized format. Design a Windows Form to display the data. Connect to the database. Bind the data to a Windows Form control. View the data. ©NIIT Accessing and Manipulating Data/Lesson 6/Slide 3 of 33
  • 4. Accessing and Manipulating Data Task 1: Identify the data that needs to be displayed. Result: As per the given problem statement, the data to be displayed is as follows: CustID FName LName Address Phone email ©NIIT Accessing and Manipulating Data/Lesson 6/Slide 4 of 33
  • 5. Accessing and Manipulating Data Task 2: Identify the mechanism to display data in a customized format. Data binding is the process of binding the retrieved data to a control on a Windows Form to be displayed in a customized format. Data binding is of two types: Simple Data Binding Complex Data Binding Result: For the given problem statement, you will use complex data binding to display the data. ©NIIT Accessing and Manipulating Data/Lesson 6/Slide 5 of 33
  • 6. Accessing and Manipulating Data Just a Minute… What is the difference between simple data binding and complex data binding? What are the controls used in each type of binding? ©NIIT Accessing and Manipulating Data/Lesson 6/Slide 6 of 33
  • 7. Accessing and Manipulating Data Task 3: Design a Windows Form to display the data. Task 4: Connect to the database. Task 5: Bind the data to a Windows Form control. Task 6: View the data. ©NIIT Accessing and Manipulating Data/Lesson 6/Slide 7 of 33
  • 8. Accessing and Manipulating Data Problem Statement 6.D.2 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 Accessing and Manipulating Data/Lesson 6/Slide 8 of 33
  • 9. Accessing and Manipulating Data Task List Identify the data that needs to be displayed. Identify the mechanism to display data in a customized format. Identify the mechanism to navigate through the data. Design a Windows Form to display the data. Connect to the database. Write the code to navigate through the data. Bind the data to a Windows Form control. View the data. ©NIIT Accessing and Manipulating Data/Lesson 6/Slide 9 of 33
  • 10. Accessing and Manipulating Data Task 1: Identify the data that needs to be displayed. Result: As per the given problem statement, the data to be displayed is as follows: CustID Fname Lname Address Phone email ©NIIT Accessing and Manipulating Data/Lesson 6/Slide 10 of 33
  • 11. Accessing and Manipulating Data Task 2: Identify the mechanism to data in a customized format. Result: For the given problem statement, you will use simple data binding to bind and display the data. ©NIIT Accessing and Manipulating Data/Lesson 6/Slide 11 of 33
  • 12. Accessing and Manipulating Data Task 3: Identify the mechanism to navigate through the data. The CurrencyManager class Exists for every data source that is bound to a Windows Form. Object handles the binding to the data source by keeping a pointer to the current item in the record list. Is derived from the BindingManagerBase class. A BindingContext object, which is a Windows Form object, is used to keep track of the existing CurrencyManager objects in a form. ©NIIT Accessing and Manipulating Data/Lesson 6/Slide 12 of 33
  • 13. Accessing and Manipulating Data Task 3: Identify the mechanism to navigate through the data. (Contd.) Relationship between the BindingContext class, CurrencyManager class, and Windows Form: Windows Form Control 1 Control 2 Control 3 CurrencyManager 1 DATA SOURCE 1 BindingContext CurrencyManager 1 DATA SOURCE 1 object CurrencyManager 1 DATA SOURCE 1 ©NIIT Accessing and Manipulating Data/Lesson 6/Slide 13 of 33
  • 14. Accessing and Manipulating Data Task 3: Identify the mechanism to navigate through the data. (Contd.) Result: You will use the BindingManagerBase class and the BindingContext() method to navigate through the records. Task 4: Design a Windows Form to display the data. Task 5: Connect to the database. Task 6: Write the code to navigate through the data. Task 7: Bind the data to a Windows Form control. Task 8: View the data. ©NIIT Accessing and Manipulating Data/Lesson 6/Slide 14 of 33
  • 15. Accessing and Manipulating Data Problem Statement 6.D.3 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 Accessing and Manipulating Data/Lesson 6/Slide 15 of 33
  • 16. Accessing and Manipulating Data Task List Identify the data that needs to be displayed. Identify the method to filter and sort the data. Identify the method to navigate through the data. Design a Windows Form to display the data. Connect to the database, and filter and sort the data. Bind the data to a Windows Form control. View the data. ©NIIT Accessing and Manipulating Data/Lesson 6/Slide 16 of 33
  • 17. Accessing and Manipulating Data Task 1: Identify the data that needs to be displayed. Result: As per the given problem statement, the data to be displayed is as follows: Inv Date CustID ProdID Cost Advance ©NIIT Accessing and Manipulating Data/Lesson 6/Slide 17 of 33
  • 18. Accessing and Manipulating Data Task 2: Identify the method to filter and sort the data. There are two methods to display filtered data: Parameterized queries ®Filter data based on the criterion entered by a user at run time. ®Are created while configuring data adapters. Filtering a dataset ®After the data is retrieved in a dataset, the data can be filtered by: ® Using the Select() method ® Filtering a data view ©NIIT Accessing and Manipulating Data/Lesson 6/Slide 18 of 33
  • 19. Accessing and Manipulating Data Task 2: Identify the method to filter and sort the data. (Contd.) The Select() method Used to filter data without changing the order of the records in the table based on the parameter passed. ©NIIT Accessing and Manipulating Data/Lesson 6/Slide 19 of 33
  • 20. Accessing and Manipulating Data Just a Minute… The records of customers having monthly income of $4200 needs to be displayed in ascending order of their names from the table Employees. Write the code to retrieve filtered records and store the retrieved records. ©NIIT Accessing and Manipulating Data/Lesson 6/Slide 20 of 33
  • 21. Accessing and Manipulating Data Task 2: Identify the method to filter and sort the data. (Contd.) 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. Multiple DataView objects can also be explicitly created for displaying different views of the same underlying data. ©NIIT Accessing and Manipulating Data/Lesson 6/Slide 21 of 33
  • 22. Accessing and Manipulating Data Task 2: Identify the method to filter and sort the data. (Contd.) Some commonly used properties of the DataView object: ®Table ®Sort ®RowFilter ®RowStateFilter ®AllowNew, AllowDelete, AllowEdit ©NIIT Accessing and Manipulating Data/Lesson 6/Slide 22 of 33
  • 23. Accessing and Manipulating Data Task 2: Identify the method to filter and sort the data. (Contd.) Result: You will use a parameterized query to filter and sort the data, as it requires you to write minimum code. ©NIIT Accessing and Manipulating Data/Lesson 6/Slide 23 of 33
  • 24. Accessing and Manipulating Data Just a Minute… The name, date of joining, and department of the employees with salary greater than $2000 need to be retrieved and displayed in a DataGrid control. Write the code to filter the data and display the filtered data. ©NIIT Accessing and Manipulating Data/Lesson 6/Slide 24 of 33
  • 25. Accessing and Manipulating Data Task 3: Identify the method to navigate through the data. Result: You will use the BindingManagerBase class and the BindingContext() method to navigate through the data. Task 4: Design a Windows Form to display the data. Task 5: Connect to the database, and filter and sort the data. Task 6: Bind the data to a Windows Form control. Task 7: View the data. ©NIIT Accessing and Manipulating Data/Lesson 6/Slide 25 of 33
  • 26. Accessing and Manipulating Data Problem Statement 6.D.4 An application needs to be created for the Diaz Telecommunications Marketing Manager to view customer details, such as the name and address, and order details for a specific customer for analyzing customer feedbacks. The customer details and the order details are present in separate tables. ©NIIT Accessing and Manipulating Data/Lesson 6/Slide 26 of 33
  • 27. Accessing and Manipulating Data Task List Identify the data that needs to be displayed. Identify the mechanism to display data from multiple tables in a single Windows Form. Design a Windows Form to display the data. Connect to the database. Create a relationship between the tables. Bind the data to the Windows Form controls. View the data from multiple tables in a single Windows Form. ©NIIT Accessing and Manipulating Data/Lesson 6/Slide 27 of 33
  • 28. Accessing and Manipulating Data Task 1: Identify the data that needs to be displayed. Result: As per the given problem statement, the data to be displayed is as follows: FName Address ProdID Inv Date CustID ©NIIT Accessing and Manipulating Data/Lesson 6/Slide 28 of 33
  • 29. Accessing and Manipulating Data Task 2: Identify the mechanism to display data from multiple tables in a single Windows Form. Tables are stored in a dataset as discrete entities but a relationship can be created between the stored tables to display data from the related tables. The column that is common in both the tables is used to create the relationship. Result: You will create a relationship between CustomerTracking and CustOrder tables to display the data from both the tables. ©NIIT Accessing and Manipulating Data/Lesson 6/Slide 29 of 33
  • 30. Accessing and Manipulating Data Task 3: Design a Windows Form to display the data. Task 4: Connect to the database. Task 5: Create a relationship between the tables. Task 6: Bind the data to the Windows Form controls. Task 7: View the data. ©NIIT Accessing and Manipulating Data/Lesson 6/Slide 30 of 33
  • 31. 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. ©NIIT Accessing and Manipulating Data/Lesson 6/Slide 31 of 33
  • 32. Accessing and Manipulating Data Summary (Contd.) 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. A data view manager is a collection of data views and is useful while working with related tables. ©NIIT Accessing and Manipulating Data/Lesson 6/Slide 32 of 33
  • 33. Accessing and Manipulating Data Summary (Contd.) 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. Tables are stored in a dataset as discrete entities, but a relationship can be created between the stored tables so that the dataset displays data from the related tables. ©NIIT Accessing and Manipulating Data/Lesson 6/Slide 33 of 33