Professional Documents
Culture Documents
Chapter Eight: Accessing Data Processing Databases
Chapter Eight: Accessing Data Processing Databases
Accessing Data
Processing Databases
8- 2
Introduction
Data is efficiently managed by storing them in
files on disk.
Data files and programs are separate.
The program does not need to be modified when
the data changes.
Different programs can share the same data
sets.
McGraw Hill/Irwin
8- 3
Introduction (cont.)
Most businesses organize their data into
databases.
A database is an organizes collection of data.
A database management system (DBMS) is a
program that is used to create and maintain
databases.
Visual Basic .NET provides tools for developers
to access databases from their programs.
McGraw Hill/Irwin
8- 4
Objectives
Understand and use relational databases.
Understand a subset of the ADO.NET object
model.
Apply the ADO.NET object model within Visual
Basic .NET to access databases.
Use the properties and methods of the DataGrid
control to display record from a DataSet.
McGraw Hill/Irwin
8- 5
Objectives (cont.)
Write SQL Select queries to extract data from a
database.
Bind controls such as TextBoxes and Labels to a
DataSet.
Create Master/Detail DataSets.
Use several tools within Visual Basic .NET to
manage and use databases.
McGraw Hill/Irwin
8- 6
8- 7
McGraw Hill/Irwin
8- 8
One-to-Many Relationships
Established by placing the key field of the one
entitys table into the many entitys table as a
foreign key.
Many-to-Many Relationships
Constructed by creating a new table with the key
fields from related tables.
McGraw Hill/Irwin
8- 9
Normalized Databases
Normalization is a process used to eliminate or
reduce data redundancy.
Designers must determine which tables to place
information in.
A table should be in third normal form.
McGraw Hill/Irwin
Database Queries
Most relational database systems use a query
language called structured query language
(SQL).
To specify how to combine data in related tables.
To specify how to select only the desired data.
McGraw Hill/Irwin
810
McGraw Hill/Irwin
811
McGraw Hill/Irwin
812
McGraw Hill/Irwin
813
McGraw Hill/Irwin
814
McGraw Hill/Irwin
815
CurrentCell
CurrentRowIndex
DataMember
DataSource
Enabled
FirstVisibleColumn
ForeColor
GridLineColor
GridLineStyle
HeaderBackColor
HeaderFont
816
McGraw Hill/Irwin
817
Collapse(row)
Expand(row)
IsExpanded(row)
IsSelected(row)
Select(row)
SetDataBinding(dataSourceObject,
dataMemberString)
UnSelect(row)
McGraw Hill/Irwin
818
McGraw Hill/Irwin
819
McGraw Hill/Irwin
820
821
McGraw Hill/Irwin
822
Chapter Summary
A database is an organized collection of data
and relationships that describe entities of
interest to a business.
An entity-relationship diagram (ERD)
documents entities and their relationships.
Visual Basic .NET supports the relational
database approach for organizing data.
Normalization is process used to minimize
data redundancy.
McGraw Hill/Irwin
823
824
McGraw Hill/Irwin
825