Databases - C Sharp Programming - Lecture Slides, Slides of C programming

Some concept of C Sharp Programming are Additional Controls, Declaring Arrays, Call-By-Reference Methods, Information Processing Cycle. Main points of this lecture are: Databases, Relational Database, Terminology, Binding Data, Management Systems, Various Vendors, Sqlserver, Sybase, Develop Applications, Microsoft

Typology: Slides

2012/2013

Uploaded on 04/27/2013

farooq
farooq 🇮🇳

4.3

(94)

203 documents

1 / 12

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Databases
14_databases.ppt
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Databases - C Sharp Programming - Lecture Slides and more Slides C programming in PDF only on Docsity!

Databases

14_databases.ppt

Overview of Topics

• Relational Database Terminology

• ADO.Net

• Binding data

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).

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 = “85202” All rows matching the criteria would be selected or deleted.
    • Record set commands are very powerful.
  • We’ll usually want to qualified a command by specifying a

customer id or other unique identifier using the Where clause.

C# Application Reading Database

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(dsCustomer1); The Fill method is usually placed in the form load event.

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 we’ll build a form using Labels and Textboxes.

Completing CS

  • See assignment sheet for details.