Using ADO.NET Chapter Microsoft Visual Basic.NET: Reloaded 1.

Slides:



Advertisements
Similar presentations
Data Base. Objective Become familiar with database terminology. Create a project to display data for a single database table. Use a DataGrid control.
Advertisements

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 11: Classes and Objects
BIM211 – Visual Programming Database Operations 1.
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.
1.
Chapter 12: Using ADO.NET 2.0 Programming with Microsoft Visual Basic 2005, Third Edition.
Chapter 10 Accessing Database Files Programming In Visual Basic.NET.
Chapter 12: ADO.NET and ASP.NET Programming with Microsoft Visual Basic.NET, Second Edition.
Introduction to ADO.Net, VB.Net Database Tools and Data Binding ISYS 512.
ASP.NET Database Connectivity I. 2 © UW Business School, University of Washington 2004 Outline Database Concepts SQL ASP.NET Database Connectivity.
VB.NET Database Access ISYS 812. Microsoft Universal Data Access ODBC: Open Database Connectivity –A driver manager –Used for relational databases OLE.
1 Pertemuan 09 Database Matakuliah: D0524 / Algoritma dan Pemrograman Komputer Tahun: 2005 Versi:
Introduction to ADO.Net, VB.Net Database Tools and Data Binding ISYS 512.
Microsoft Visual Basic 2012 CHAPTER TEN Incorporating Databases with ADO.NET.
Chapter Extension 6 Using Microsoft Access © 2008 Pearson Prentice Hall, Experiencing MIS, David Kroenke.
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 10 - VB.Net by Schneider1 Chapter 10 – Database Management 10.1 An Introduction to Databases 10.2 Relational Databases and SQL.
Databases and LINQ Visual Basic 2010 How to Program 1.
Programming with Microsoft Visual Basic 2012 Chapter 13: Working with Access Databases and LINQ.
Programming with Visual Basic.NET An Object-Oriented Approach  Chapter 8 Introduction to Database Processing.
Introduction to ADO.Net and Visual Studio Database Tools ISYS 512.
1 Lesson 6 — Database Programming Microsoft Visual Basic.NET, Introduction to Programming.
Chapter 10 Accessing Database Files Programming In Visual Basic.NET.
10-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Creating Web Applications Using ASP.NET Chapter Microsoft Visual Basic.NET: Reloaded 1.
Tutorial 121 Creating a New Web Forms Page You will find that creating Web Forms is similar to creating traditional Windows applications in Visual Basic.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Twelve Access Databases and LINQ.
CHAPTER EIGHT Accessing Data Processing Databases.
Programming with Microsoft Visual Basic 2008 Fourth Edition Chapter Thirteen Working with Access Databases and LINQ.
CHAPTER EIGHT Accessing Data Processing Databases.
 2006 Pearson Education, Inc. All rights reserved Database, SQL and ADO.NET.
Objectives In this lesson, you will learn to: *Identify the need for ADO.NET *Identify the features of ADO.NET *Identify the components of the ADO.NET.
Chapter Thirteen Working with Access Databases and LINQ Programming with Microsoft Visual Basic th Edition.
Creating Classes and Objects Chapter Microsoft Visual Basic.NET: Reloaded 1.
Module 9: Accessing Relational Data Using Microsoft Visual Studio.NET.
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.
Chapter Thirteen Working with Access Databases and LINQ Programming with Microsoft Visual Basic th Edition.
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.
1.
Introduction to ADO.Net and VS Database Tools and Data Binding ISYS 350.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 25.1 Test-Driving the ATM Application 25.2.
1.
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.
Chapter 24 I’m Suffering from Information Overload (Access Databases) Clearly Visual Basic: Programming with Visual Basic nd Edition.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Address Book Application Introducing Database Programming.
Chapter 5 Introduction To Form Builder. Lesson C Objectives  Use sequences to automatically generate primary key values in a form  Create lists of values.
Chapter Fourteen Access Databases and SQL Programming with Microsoft Visual Basic th Edition.
Chapter 9 Working with Databases. Copyright © 2011 Pearson Addison-Wesley Introduction In this chapter you will learn: – Basic database concepts – How.
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.
Developing Visual Basic Applications to Interact with an Access Database Training Session Brian R. Kovar Kansas State University 8 th AIS Educator Annual.
1 SQL SERVER 2005 Express CE-105 SPRING 2007 Engr. Faisal ur Rehman.
Microsoft Visual Basic 2010: Reloaded Fourth Edition
Incorporating Databases with ADO.NET
Incorporating Databases with ADO.NET
Brief description on how to navigate within this presentation (ppt)
CIS16 Application Programming with Visual Basic
Chapter 10 ADO.
Database Applications
Chapter 10 Accessing Database Files
Unit – V Data Controls.
Introduction to ADO.Net and Visual Studio Database Tools.
Presentation transcript:

Using ADO.NET Chapter Microsoft Visual Basic.NET: Reloaded 1

2 Objectives Define the terms used when talking about databases Explain the purpose of the DataAdapter, Connection, and DataSet objects Explain the role of the provider Create and configure an OleDbDataAdapter object Write SQL SELECT statements

3 Microsoft Visual Basic.NET: Reloaded Objectives ( continued ) Create a dataset Display a dataset in various controls in an interface Position the record pointer in a dataset

4 Microsoft Visual Basic.NET: Reloaded Database Terminology Database Organized collection of related information stored in a file on a disk Relational database stores information in tables composed of columns and rows Table is a group of related records Each row represents a record Each column represents a row Primary key is a field that uniquely identities a record in a table Foreign key is a field in one table used as the primary key in another table Tables are related by a common field or fields

5 Microsoft Visual Basic.NET: Reloaded Database Terminology ( continued )

6 Microsoft Visual Basic.NET: Reloaded Database Terminology ( continued )

7 Microsoft Visual Basic.NET: Reloaded ADO.NET A Connection object is used to establish a temporary connection to a database Requests for information are then submitted using a DataAdapter object The DataAdapter uses a provider which translates the request into a language the database understands A DataSet stores a copy of the records and fields requested in a internal memory location

8 Microsoft Visual Basic.NET: Reloaded ADO.NET ( continued )

9 Microsoft Visual Basic.NET: Reloaded ADO.NET ( continued )

10 Microsoft Visual Basic.NET: Reloaded Creating and Configuring a DataAdapter Object

11 Microsoft Visual Basic.NET: Reloaded Creating and Configuring a DataAdapter Object ( continued )

12 Microsoft Visual Basic.NET: Reloaded Creating and Configuring a DataAdapter Object ( continued )

13 Microsoft Visual Basic.NET: Reloaded Creating and Configuring a DataAdapter Object ( continued )

14 Microsoft Visual Basic.NET: Reloaded Creating and Configuring a DataAdapter Object ( continued )

15 Microsoft Visual Basic.NET: Reloaded Creating and Configuring a DataAdapter Object ( continued )

16 Microsoft Visual Basic.NET: Reloaded SQL Structured Query Language (SQL) A set of commands that allows you to access and manipulate the data stored in many database management systems on computers of all sizes SELECT statement allow you to specify which fields and records you want to view WHERE clause limits records to be selected ORDER BY clause sorts record display order

17 Microsoft Visual Basic.NET: Reloaded HOW TO…

18 Microsoft Visual Basic.NET: Reloaded HOW TO… ( continued )

19 Microsoft Visual Basic.NET: Reloaded Using the Query Builder to Enter a SELECT Statement

20 Microsoft Visual Basic.NET: Reloaded Using the Query Builder to Enter a SELECT Statement ( continued )

21 Microsoft Visual Basic.NET: Reloaded Using the Query Builder to Enter a SELECT Statement ( continued )

22 Microsoft Visual Basic.NET: Reloaded Using the Query Builder to Enter a SELECT Statement ( continued )

23 Microsoft Visual Basic.NET: Reloaded Using the Query Builder to Enter a SELECT Statement ( continued )

24 Microsoft Visual Basic.NET: Reloaded Using the Query Builder to Enter a SELECT Statement ( continued )

25 Microsoft Visual Basic.NET: Reloaded Using the Query Builder to Enter a SELECT Statement ( continued )

26 Microsoft Visual Basic.NET: Reloaded Creating a DataSet

27 Microsoft Visual Basic.NET: Reloaded Creating a DataSet ( continued )

28 Microsoft Visual Basic.NET: Reloaded Creating a DataSet ( continued ) XML (Extensible Markup Language) XML schema definition file defines the tables and fields that make up the data set Schema file is automatically generated by VB.NET Contents of file may be viewed in IDE Contents of dataset can be preview by right clicking the DataAdapter object in the component tray and clicking Preview Data

29 Microsoft Visual Basic.NET: Reloaded Creating a DataSet ( continued )

30 Microsoft Visual Basic.NET: Reloaded Using the Fill Method Method of the DataAdapter object Fills a dataset with data while the application is running

31 Microsoft Visual Basic.NET: Reloaded Binding the Dataset Object to a DataGrid Control Connecting a DataSet object to a control is called “binding” Connected controls are referred to as “bound controls”

32 Microsoft Visual Basic.NET: Reloaded HOW TO…

33 Microsoft Visual Basic.NET: Reloaded Binding the Dataset Object to a DataGrid Control ( continued )

34 Microsoft Visual Basic.NET: Reloaded Reconfiguring the DataAdapter Object

35 Microsoft Visual Basic.NET: Reloaded Reconfiguring the DataAdapter Object ( continued )

36 Microsoft Visual Basic.NET: Reloaded Reconfiguring the DataAdapter Object ( continued )

37 Microsoft Visual Basic.NET: Reloaded Binding the Dataset Object to a Label Control or Text box

38 Microsoft Visual Basic.NET: Reloaded Binding the Dataset Object to a Label Control or Text box ( continued )

39 Microsoft Visual Basic.NET: Reloaded Binding the Dataset Object to a Label Control or Text box ( continued )

40 Microsoft Visual Basic.NET: Reloaded Binding the Dataset Object to a Label Control or Text box ( continued )

41 Microsoft Visual Basic.NET: Reloaded Programming Example – Cartwright Industries Application Carl Simons, the sales manager at Cartwright Industries, records the item number, name, and price of each product the company sells in a database named Items.mdb The database is contained in the VbDotNet\Chap12\Databases folder. Mr. Simons wants an application that the sales clerks can use to enter an item number and then display the item’s price

42 Microsoft Visual Basic.NET: Reloaded Programming Example – Cartwright Industries Application ( continued ) Items.mdb database opened in Microsoft Access. Database contains one table tblItems

43 Microsoft Visual Basic.NET: Reloaded TOE Chart

44 Microsoft Visual Basic.NET: Reloaded User Interface

45 Microsoft Visual Basic.NET: Reloaded Objects, Properties, and Settings

46 Microsoft Visual Basic.NET: Reloaded Tab Order

47 Microsoft Visual Basic.NET: Reloaded Pseudocode btnExit Click event procedure 1. close application frmCartwright Load event procedure 1. fill the dataset with the item numbers and prices from the Items.mdb database

48 Microsoft Visual Basic.NET: Reloaded Code

49 Microsoft Visual Basic.NET: Reloaded Summary Databases created by Microsoft Access are relational databases: Can contain one or more tables Most tables contain a primary key that uniquely identifies each record Data in relational database can be displayed in any order, and you can control the amount of information you want to view Visual Basic.NET uses a technology called ADO.NET to access the data stored in a database

50 Microsoft Visual Basic.NET: Reloaded Summary ( continued ) Connection between a database and an application that uses ADO.NET is only temporary To access data stored in a database, first create and configure a DataAdapter object, which is the link between the application and the Connection object Use an OleDbDataAdapter object and an OleDbConnection object in applications that access Microsoft Access databases

51 Microsoft Visual Basic.NET: Reloaded Summary ( continued ) DataAdapter, Connection, and DataSet objects are stored in component tray Use SQL SELECT statement to specify fields and records for a dataset Query Builder provides a convenient way to create a SELECT statement Dataset contains data you want to access from the database Data specified in SELECT statement associated with DataAdapter object

52 Microsoft Visual Basic.NET: Reloaded Summary ( continued ) Use DataAdapter object’s Fill method to fill a dataset with data while an application is running Users view data stored in a dataset through controls that are bound to DataSet object Use DataGrid control to display records contained in a dataset When you change the SELECT statement associated with a DataAdapter object, you must regenerate the dataset