Chapter 24 I’m Suffering from Information Overload (Access Databases) Clearly Visual Basic: Programming with Visual Basic 2010 2 nd Edition.

Slides:



Advertisements
Similar presentations
RightNow 8 -- Adding a new report: New > Report: ORAnalytics > Reports > New Report
Advertisements

Data Base. Objective Become familiar with database terminology. Create a project to display data for a single database table. Use a DataGrid control.
Chapter 10 Database Applications Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
 Open the Paradise.exe file  Application displays records in the Books database  Allows the store manager to enter an author’s name (or part of a name)
Chapter 14.3 LINQ to SQL Programming in Visual Basic 2010: The Very Beginner’s Guide by Jim McKeown Databases – Part 3.
Chapter 18 - Data sources and datasets 1 Outline How to create a data source How to use a data source How to use Query Builder to build a simple query.
Chapter 12: Using ADO.NET 2.0 Programming with Microsoft Visual Basic 2005, Third Edition.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
Chapter 12: ADO.NET and ASP.NET Programming with Microsoft Visual Basic.NET, Second Edition.
Using ADO.NET Chapter Microsoft Visual Basic.NET: Reloaded 1.
1 Pertemuan 09 Database Matakuliah: D0524 / Algoritma dan Pemrograman Komputer Tahun: 2005 Versi:
EGR 141 Computer Problem Solving in Engineering and Computer Science Interfacing with a Database in Visual Basic.NET 2005.
Management Information Systems MS Access 2003 By: Mr. Imdadullah Lecturer, Department of M.I.S. College of Business Administration, KSU.
CSCI 3328 Object Oriented Programming in C# Chapter 12: Databases and LINQ 1 Xiang Lian The University of Texas – Pan American Edinburg, TX 78539
Database Software Application
From VS C# 2010 Programming, John Allwork 1 VS2010 C# Programming - DB intro 1 Topics – Database Relational - linked tables SQL ADO.NET objects Referencing.
Some Basic Database Terminology
CHAPTER 9 DATABASE MANAGEMENT © Prepared By: Razif Razali.
An INTRODUCTION to MICROSOFT ACESS 2000 By Dr. Ennis-Cole.
Unit J: Creating a Database Microsoft Office Illustrated Fundamentals.
Databases and LINQ Visual Basic 2010 How to Program 1.
Programming with Microsoft Visual Basic 2012 Chapter 13: Working with Access Databases and LINQ.
Chapter 11 Introduction to Database Processing. Class 11: Database Processing Use a Visual Studio Wizard to establish a database connection used to load.
Introduction to ADO.Net and Visual Studio Database Tools ISYS 512.
Programming with Microsoft Visual Basic 2012 Chapter 12: Web Applications.
10-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Chapter 15: Using LINQ to Access Data in C# Programs.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Twelve Access Databases and LINQ.
Microsoft Access 2003 Define some key Access terminology: Field – A single characteristic or attribute of a person, place, object, event, or idea. Record.
1 Data Bound Controls II Chapter Objectives You will be able to Use a Data Source control to get data from a SQL database and make it available.
Programming with Microsoft Visual Basic 2008 Fourth Edition Chapter Thirteen Working with Access Databases and LINQ.
Management Information Systems MS Access MS Access is an application software that facilitates us to create Database Management Systems (DBMS)
Relational Databases (MS Access)
Key Applications Module Lesson 21 — Access Essentials
XP New Perspectives on Microsoft Access 2002 Tutorial 1 1 Microsoft Access 2002 Tutorial 1 – Introduction To Microsoft Access 2002.
MS Access 2007 Management Information Systems 1. Overview 2  What is MS Access?  Access Terminology  Access Window  Database Window  Create New Database.
Chapter Thirteen Working with Access Databases and LINQ Programming with Microsoft Visual Basic th Edition.
Tutorial 91 Databases A database is an organized collection of related information stored in a file on a disk A database allows companies to store information.
Using Adapter Wizard ISYS 512. Data Adapter Wizard – 2 nd Level of Using ADO.Net Configure Data Adapter and generating a dataset: –From the Data tab of.
Unit 5, Lesson 1 Working with Databases. Objectives Identify the parts of the Access screen. Identify the parts of the Access screen. Understand the purpose.
Unit 5, Lesson 2 Editing Records and Using Forms.
1/62 Introduction to and Using MS Access Database Management and Analysis Yunho Song.
Chapter Thirteen Working with Access Databases and LINQ Programming with Microsoft Visual Basic th Edition.
CSCI 3327 Visual Basic Chapter 13: Databases and LINQ UTPA – Fall 2011.
Databases with LINQ. LINQ to SQL LINQ to SQL uses LINQ syntax to query databases. LINQ to SQL classes are automatically generated by the IDE’s LINQ to.
1 Chapter 20 – Data sources and datasets Outline How to create a data source How to use a data source How to use Query Builder to build a simple query.
Ch. 101 Database Management An Introduction to Databases.
Chapter Fourteen Access Databases and SQL Programming with Microsoft Visual Basic th Edition.
INTRODUCTION TO ACCESS. OBJECTIVES  Define the terms field, record, table, relational database, primary key, and foreign key  Create a blank database.
Databases and ADO.NET Programming Right from the Start with Visual Basic.NET 1/e 11.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 25 I’m Suffering from Information Overload.
1 Chapter 10 – Database Management 10.1 An Introduction to Databases 10.2 Editing and Designing Databases.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Address Book Application Introducing Database Programming.
Understand Databound Controls Windows Development Fundamentals LESSON 4.2A.
CSCI 3327 Visual Basic Chapter 13: Databases and LINQ UTPA – Fall 2011.
Chapter Fourteen Access Databases and SQL Programming with Microsoft Visual Basic th Edition.
COMPREHENSIVE Access Tutorial 1 Creating a Database.
Chapter 9 Working with Databases. Copyright © 2011 Pearson Addison-Wesley Introduction In this chapter you will learn: – Basic database concepts – How.
1 Access Lesson 1 Understanding Access Fundamentals Microsoft Office 2010 Fundamentals Story / Walls.
Creating SQL Database file And Displaying a Database Table in a DataGridView.
Programming with Microsoft Visual Basic 2012 Chapter 14: Access Databases and SQL.
Programming with Microsoft Visual Basic 2012 Chapter 13: Working with Access Databases and LINQ.
Microsoft Visual Basic 2010: Reloaded Fourth Edition
Visual Basic 2010 How to Program
Microsoft Access 2003 Illustrated Complete
Access Lesson 1 Understanding Access Fundamentals
CIS16 Application Programming with Visual Basic
Database Applications
Introduction to ADO.Net and Visual Studio Database Tools.
Presentation transcript:

Chapter 24 I’m Suffering from Information Overload (Access Databases) Clearly Visual Basic: Programming with Visual Basic nd Edition

Objectives Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 2 After studying Chapter 24, you should be able to: Define basic database terminology Connect an application to a Microsoft Access database Bind table and field objects to controls Customize a DataGridView control Handle exceptions using the Try…Catch statement Position the record pointer in a dataset

Keeping Good Records Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 3 Computer database Electronic file that contains an organized collection of related information Relational database Stores information in tables composed of columns and rows Field Single item of information about a person, place, or thing

Keeping Good Records (cont’d.) Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 4 Record Group of related fields that contain all the necessary data about a specific person, place, or thing Table Group of related records Primary key Field that uniquely identifies each record in a table 4

Keeping Good Records (cont’d.) Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 5 5 Figure 24-1 Example of a one-table relational database

Keeping Good Records (cont’d.) Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 6 Figure 24-2 CD_Number field Primary key in parent table CD_Number field in child table Used solely to link song title and track information to the appropriate CD in parent table Child table CD_Number field is called the foreign key 6

Keeping Good Records (cont’d.) Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 7 7 Figure 24-2 Example of a two-table relational database

Connecting …Connecting Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 8 Figure 24-3 Emp_Number field is the primary key Status field contains the employment status Code field identifies the employee’s department Data Source Configuration Wizard Easy way to connect an application to a database 8

Connecting …Connecting (cont’d.) Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 9 9 Figure 24-3 Data contained in the tblEmploy table

Let the Computer Do It Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 10 Binding Connecting an object to a control Bound controls The connected controls DataGridView control Displays data in row and columnar format, similar to a spreadsheet One of the most popular controls for displaying table data 10

Let the Computer Do It (cont’d.) Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 11 Figure 24-7 DataGridView control’s task list

Let the Computer Do It (cont’d.) Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 12 While an application is running, you can use the BindingNavigator control to: Move from one record to the next in the dataset Add or delete a record and save any changes made to the dataset Component tray Stores objects that do not appear in the user interface while an application is running TableAdapter object in the component tray Connects the database to the DataSet object 12

Let the Computer Do It (cont’d.) Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 13 TableAdapterManager object Used to save changes made to the database BindingSource object Provides the connection between the DataSet and the bound controls on the Form TblEmployBindingSource in Figure 24-8: Connects EmployeesDataSet to two bound controls DataGridView control and BindingNavigator control Figure 24-9 Illustrates relationships 13

Let the Computer Do It (cont’d.) Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 14 Figure 24-8 Result of dragging the tblEmploy object to the form

Let the Computer Do It (cont’d.) Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 15 Figure 24-9 Illustration of the relationships among the database, the objects in the component tray, and the bound controls

The Copy to Output Directory Property Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 16 When the Data Source Configuration Wizard connects an application to a database: It adds the database file to the application’s project folder Method of saving changes to a local database file Is determined by the file’s Copy to Output Directory property 16

How Does Visual Basic Do It? Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 17 When a table or field object is dragged to the form: Computer adds the appropriate controls and objects to the application A form’s Load event Occurs when the application is started and the form is displayed for the first time Load event procedure Code to fill a dataset with data belongs here in most applications 17

Thank You for Catching My Errors Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 18 Exceptions Handled in Visual Basic by displaying an error message and then abruptly terminating the application Try…Catch statement Used to take control of the exception handling in your code 18

Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 19 Figure Syntax and examples of the Try…Catch statement (continues)

Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 20 Figure Syntax and examples of the Try…Catch statement (cont’d.)

I’ll Use My Own Controls, Thank You Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 21 To bind an object in a dataset to an existing control on the form: Drag the object from the Data Sources window to the control Or click the control Then set one or more properties in the Properties window Appropriate property to set depends on the control you are binding 21

Coding the Next Record and Previous Record Buttons Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 22 BindingSource object Uses an invisible record pointer to keep track of the current record in the dataset Position property Stores the position of the record pointer Move methods Can be used to position the record pointer in a dataset Moves the pointer to the first, last, next, or previous record 22

Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 23 Figure Syntax and examples of the BindingSource object’s Position property

Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 24 Figure Syntax and examples of the BindingSource object’s Move methods

Summary Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 25 Relational databases can contain one or more tables Data in a relational database Can be displayed in any order Most tables contain a primary key that uniquely identifies each record To access the data stored in a database: First connect the application to the database

Summary (cont’d.) Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 26 TableAdapter object Connects a database to a DataSet object DataGridView control Displays data in row and column format Try…Catch statement Used to handle exceptions that occur while an application is running BindingSource object Uses an invisible record pointer to keep track of the current record in a dataset 26