CIS162AD - PowerPoint PPT Presentation

1 / 12
About This Presentation
Title:

CIS162AD

Description:

Each row represents the data for one record (a person, inventory item, course information) ... Click on the plus sign in front of Tables to expand list. Select ... – PowerPoint PPT presentation

Number of Views:51
Avg rating:3.0/5.0
Slides: 13
Provided by: JuanMa4
Category:
Tags: cis162ad

less

Transcript and Presenter's Notes

Title: CIS162AD


1
CIS162AD
  • Databases
  • 14_databases.ppt

2
Overview of Topics
  • Relational Database Terminology
  • ADO.Net
  • Binding data

3
Relational Databases
  • Most data is now stored in relational database
    management systems (DBMS or RDBMS).
  • There are various vendors to choose formOracle,
    MS SqlServer, Sybase, IBM DB2, etc.
  • Visual Studio is usually used to develop
    applications that store data in Microsoft
    SqlServer.
  • In this class we will use MS Access, due to
    SqlServers installation requirements.
  • Those of you familiar with Access know that it
    has a built-in form and report designer.
    However, keep in mind that we would normally be
    accessing a database stored in SqlServer, which
    does not have built-in tools.

4
Database Terminology
  • A database is made up of one or more related
    tables.
  • Conceptually a table is made up of rows and
    columns (2D Array).
  • Each row represents the data for one record(a
    person, inventory item, course information).
  • Each column (field) is a data element (name,
    address, city, state, zip).
  • Tables have a Primary Key Field to uniquely
    identify each record(Id number, part number,
    account number).
  • Relationships between various tables can be
    defined.
  • A DBMS stores everything (tables, columns,
    relationships, etc.) about the database in system
    tables.
  • System and data tables are usually stored in one
    file (CSMail.mbd).

5
SQL Structured Query Language
  • SQL is pronounced sequel.
  • SQL Structured Query Language Basic set of
    commands that are common in all DBMS.
  • DBMS vendors may add additional commands.
  • SQL commands are usually processed against a
    record set.
  • Select name, address From customer where zip
    85202
  • Delete From customer where zip 85202All rows
    matching the criteria would be selected or
    deleted.
  • Record set commands are very powerful.
  • Well usually want to qualified a command by
    specifying a customer id or other unique
    identifier using the Where clause.

6
An Access Table
Columns
Row
7
C Application Reading Database
8
Accessing a Database ADO.Net
  • Use ActiveX Data Objects (ADO)
  • An Access database uses the following objects
  • OleDbConnection connection tool establishes a
    link to a data source.
  • OleDbDataAdapter data adapter handles
    retrieving and updating the data and creates a
    Dataset.
  • Dataset bind columns in the Dataset to controls
    (textbox, listbox) by setting the DataBinding
    property.
  • Use the Fill method of the data adapter to load
    the data into the dataset, daCustomer.Fill(dsCusto
    mer1) The Fill method is usually placed in the
    form load event.

9
Accessing and Presenting Data
10
Data Binding
  • Complex Binding
  • Connect more than one data element to a control.
  • DataGridView uses complex binding because several
    columns from the table are displayed in the same
    control.
  • Simple Binding
  • Connect one data element to a control.
  • Connect a textbox to the name column (etc.)
  • May use Data Bindings property and select the
    column from the database that should be displayed
    in control.
  • Later well build a form using Labels and
    Textboxes.

11
Completing CS13
  • See assignment sheet for details.

12
Summary
  • Relational Database Terminology
  • ADO.Net
  • Binding data
Write a Comment
User Comments (0)
About PowerShow.com