DOC PREVIEW
UCR CS 5 - Lecture

This preview shows page 1-2-3-4-5-6-41-42-43-44-45-46-83-84-85-86-87-88 out of 88 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Chapter 11 – Introduction to Database ConceptsSlide 2Slide 3Slide 4Slide 5Slide 6Slide 7Slide 8Slide 9Slide 10Slide 11Slide 12Slide 13Slide 14Slide 15Slide 16Slide 17Slide 18Slide 19Slide 20Slide 21Slide 22Slide 23Slide 24Slide 25Slide 26Slide 27Slide 28Slide 29Slide 30Slide 31Slide 32Slide 33Slide 34Slide 35Slide 36Slide 37Slide 38Slide 39Slide 40Slide 41Slide 42Slide 43Slide 44Slide 45Slide 46Slide 47Slide 48Slide 49Slide 50Slide 51Slide 52Slide 53Slide 54Slide 55Slide 56Slide 57Slide 58Slide 59Slide 60Slide 61Slide 62Slide 63Slide 64Slide 65Slide 66Slide 67Slide 68Slide 69Slide 70Slide 71Slide 72Slide 73Slide 74Slide 75Slide 76Slide 77Slide 78Slide 79Slide 80Slide 81Slide 82Slide 83Slide 84Slide 85Slide 86Slide 87Slide 88The Visual Basic .NET Coach1Chapter 11 – Introduction to Database Concepts Introduce the concepts of a database Introduce the objects required to connect a Visual Basic .NET application to a database Explain basic operations in displaying and navigating through data stored in a database on a form via controls Explain how to add, edit, and delete data stored in a database Explain how to bind data in a database to data grid controlsThe Visual Basic .NET Coach2Chapter 11 – Introduction to Database ConceptsIf data is stored on a hard drive in no apparent order, it is just that, data. Data can be thought of as the raw values obtained from a process. If data is organized into a meaningful format so that it becomes valuable in answering questions, it has become information. A database is a collection of tables organized so that the data makes sense. A table usually contains data relating to one entity. Observe the table shown in Figure 11.1, which stores the names of six basketball players and their statistics.The Visual Basic .NET Coach3Chapter 11 – Introduction to Database ConceptsYou may notice that a table looks very much like the MS flex grid control you used earlier. While the MS flex grid control contains rows (known as records) and columns (known as fields) and is similar in appearance, tables have an important difference. Data validation occurs when values are entered into a table. Different software packages, known as database management systems (DBMSs), allow the user to specify different types of constraints on the data being entered. the table shown in Figure 11.1 was created, the following data types were associated with each field: Field Name Data Type Size LastName Text 15 FirstName Text 10 Team Text 15 GamesPlayed Number Integer Points Number Integer Rebounds Number Integer Assists Number IntegerThe Visual Basic .NET Coach4Chapter 11 – Introduction to Database Concepts11.1 Displaying Data Stored in a DatabaseOne of the single most important features of Visual Basic .NET is the ease with which it allows the programmer to access data stored in a database. The Database ObjectsTo display data in a form, you will require the use of three objects and a control to display them. The DatabaseA database can be any one of many sources that store data. In all of the examples in this text, the database will be a Microsoft Access database stored in a file with an extension of .mdb. The ConnectionThe first object you will use to access a database is the OleDbConnection. When you wish to access a database, you will need to communicate to Visual Basic .NET many specifics about the database that you are connecting to.The Visual Basic .NET Coach5Chapter 11 – Introduction to Database ConceptsThe Data AdapterA data adapter provides the methods to transfer information from the database to the data set using the OleDbDataAdapter. Different mechanisms exist to specify the data that will be transferred from the database to your application. Most common is the use of an industry standard series of statements defined with a language called SQL. Information is transferred from the database to the data set using the Fill method. Information is transferred from the data set back to the database using the Update method.The Visual Basic .NET Coach6Chapter 11 – Introduction to Database ConceptsThe Data SetA DataSet object can be thought of as a temporary representation of the data contained in the database that you are connected to. While a DataSet object has a great deal of functionality, for now, you will focus solely on its ability to cache the contents of a database that you will be accessing. Any changes you wish to make to data in a database is first made to the data set and then the table is updated through the data adapter.The Visual Basic .NET Coach7Chapter 11 – Introduction to Database ConceptsExample: Simple Application with Text Boxes Connected to a DatabaseTypically, when data is displayed, your application will require a few basic navigational operations. When a form loads with a data control and associated text boxes, it will display the first record in the table it is associated with. Since Allen Iverson was the first player in the table, his data is shown.The Visual Basic .NET Coach8Chapter 11 – Introduction to Database ConceptsExample: Simple Application with Text Boxes Connected to a DatabaseApplication showing second record of table Application showing last record in table Application showing next-to-last record in tableThe Visual Basic .NET Coach9Chapter 11 – Introduction to Database ConceptsCreating the Basketball Stats Project Create a project called BasketballTextBoxes. Configuring the Controls The first step in creating a form to access a database is to add and configure the OleDbConnection, OleDbDataAdapter, and DataSet objects. Adding and Configuring the OleDbConnection ObjectThe first configuration you must perform is to form a connection with the database. Step 1: Place an OleDbConnection object from the Data tab of the Toolbox.Step 2: Click on the ConnectionString property in the Properties window. A pull-down icon will appear in the Properties window. If you click on the pull-down icon, a pop-up menu will appear.Step 3: Click on the <New Connection …> menu item. The Data Link Properties window will appear.The Visual Basic .NET Coach10Chapter 11 – Introduction to Database ConceptsConnection Tab of the Data Link Properties windowThe Visual Basic .NET Coach11Chapter 11 – Introduction to Database ConceptsStep 4: Click on the Provider tab in the Data Link Properties window. Step 5: Select Microsoft Jet 4.0 OLE DB Provider.The Visual Basic .NET Coach12Chapter 11 – Introduction to Database


View Full Document

UCR CS 5 - Lecture

Download Lecture
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?