Title: Web-Enabled Decision Support Systems
1Web-Enabled Decision Support Systems
- Database Connectivity with ADO .NET
Prof. Name
name_at_email.com Position
(123) 456-7890 University Name
2Overview
- 14.1 Introduction
- 14.2 Database Applications Overview
- 14.3 Hands-On Tutorial Creating a Simple
Database Application - 14.4 Auto-Created Objects in the Component Tray
- 14.5 Hands-On Tutorial Displaying Data in
Individual Windows Controls - 14.6 Hands-On Tutorial Binding Data to Existing
Controls - 14.7 Hands-On Tutorial Displaying Related Data
on a Windows Form - 14.8 DataGridView Control
- 14.9 Hands-On Tutorial Creating a Search Form
- 14.10 The Query Builder
- 14.11 Hands-On Tutorial Creating a Look-up Table
- 14.12 Data Binding Properties of a ComboBox
Control - 14.13 In-Class Assignment
- 14.14 Summary
3Introduction
- A database application is a computer program that
allow users to manipulate data in a DBMS through
a user-friendly interface - Examples
- Amazon.com
- Online shopping
- Mapquest.com
- Driving directions
- University portals
- Transcripts and tuition payment information
4Overview
- 14.1 Introduction
- 14.2 Database Applications Overview
- 14.3 Hands-On Tutorial Creating a Simple
Database Application - 14.4 Auto-Created Objects in the Component Tray
- 14.5 Hands-On Tutorial Displaying Data in
Individual Windows Controls - 14.6 Hands-On Tutorial Binding Data to Existing
Controls - 14.7 Hands-On Tutorial Displaying Related Data
on a Windows Form - 14.8 DataGridView Control
- 14.9 Hands-On Tutorial Creating a Search Form
- 14.10 The Query Builder
- 14.11 Hands-On Tutorial Creating a Look-up Table
- 14.12 Data Binding Properties of a ComboBox
Control - 14.13 In-Class Assignment
- 14.14 Summary
5Database Application Types
- We classify database applications into the
following three categories - Display-oriented applications
- Display data retrieved from a relational database
on forms or web pages - Examples Online newspapers, portal to view
student transcript and grades, mapping websites - Transaction-oriented applications
- Involve frequent transfer of data to and from a
database - Examples Online shopping, portal for university
faculty to enter student grades - Communication-oriented applications
- Communicate with other applications or processes
- Examples Application with underlying
optimization software, Crystal Reports, Map Point
6Database Application Overview
- A VB .NET database application involves
connectivity between a database and a graphical
user interface (GUI) - Achieved through ActiveX Data Objects (ADO) .NET
- A collection of objects (classes) designed to
support data access and manipulation - The ADO .NET architecture forms the basis of VB
.NET database applications - ADO .NET object examples
- Connection object
- TableAdapter object
- DataSet object
7Database Application Processes
- Connecting to the database
- Establish a two-way communication channel via
Connection object - Fetching data using database queries
- Bring data into an application in the desired
format (filtered, sorted, etc.) via TableAdapter
object - Temporarily storing the result somewhere
- Via DataSet object
- Displaying data on Windows forms
- Data binding
- Editing data in the application
- Saving updated data back in the database
8Database Application Data Cycle
Database Application Data Cycle
9Overview
- 14.1 Introduction
- 14.2 Database Applications Overview
- 14.3 Hands-On Tutorial Creating a Simple
Database Application - 14.4 Auto-Created Objects in the Component Tray
- 14.5 Hands-On Tutorial Displaying Data in
Individual Windows Controls - 14.6 Hands-On Tutorial Binding Data to Existing
Controls - 14.7 Hands-On Tutorial Displaying Related Data
on a Windows Form - 14.8 DataGridView Control
- 14.9 Hands-On Tutorial Creating a Search Form
- 14.10 The Query Builder
- 14.11 Hands-On Tutorial Creating a Look-up Table
- 14.12 Data Binding Properties of a ComboBox
Control - 14.13 In-Class Assignment
- 14.14 Summary
10Create the Project
- How-to Create a Simple Database Application
- In Visual Studio, choose the File New Project
option from the Main menu to open the New Project
dialog box. - Make sure to select the Windows Application icon
in the Templates area. - Name the project DatabaseConnectivity and click
OK.
11Create a Data Source
- Choose the Data Show Data Sources option from
the Main menu. - In the Data Sources Window, click Add New Data
Source to start the Data Source Configuration
Wizard.
Opening the Data Sources Window
Invoking the Data Sources Configuration Wizard
12Create a Data Source (cont.)
- Select the Database icon on the Choose a Data
Source Type page of the wizard. Click Next.
Choosing a Data Source Type
13Create a Data Source (cont.)
- On the Choose Your Data Connection page, click
New Connection to open the Choose Data Source
dialog box.
Specifying the Data Connection
14Create a Data Source (cont.)
- Select the Microsoft Access Database File in the
Data Source list box. Click on Continue. - In the Add Connection dialog box that opens,
select the University database file. Click Test
Connection to verify the connection. Click OK.
Creating the Database Connection
15Create a Data Source (cont.)
- Click Yes to copy the database to the current
project folder. Click Next. - On the Save the Connection String to the
Application Configuration File page, save the
connection string with its default name. Click
Next.
Saving the Connection String
16Create a Data Source (cont.)
- Expand the Tables node on the Choose your
Database Objects page, and select the student,
department, transcript, and faculty tables. Click
Finish.
Selecting Database Tables for a Data Source
17Using a DataGridView Control
- In the Data Sources Window, drag the student
table onto Form1 to create the DataGridView
control along with a ToolStrip at the top of the
form. - The ToolStrip provides controls for navigation,
adding/deleting records, and saving data
Drag-and-Drop to Create DataGridView Control
Snapshot of the Component Tray
18Test the Application
- Press Ctrl F5 to run the application.
- Test the ToolStrip functionality by navigating
through the student records. - Alter values in the DataGridView control, and
click on the Save button in the ToolStrip to
modify the data.
Application Output
19Property Window Review
- Click the smart tag on the DataGridView control
to view its Tasks list. - Note that the DataSource property is set to the
TblStudentBindingSource. - Also note the automatic enabling of various
options.
Tasks List of a DataGridView Control
20Code Review
- Double click anywhere on the form to open the
code behind window. - Review the auto-generated code that was created
when we dragged the student table from the Data
Sources Window.
Form1_Load Event Populating the Student DataTable
21Overview
- 14.1 Introduction
- 14.2 Database Applications Overview
- 14.3 Hands-On Tutorial Creating a Simple
Database Application - 14.4 Auto-Created Objects in the Component Tray
- 14.5 Hands-On Tutorial Displaying Data in
Individual Windows Controls - 14.6 Hands-On Tutorial Binding Data to Existing
Controls - 14.7 Hands-On Tutorial Displaying Related Data
on a Windows Form - 14.8 DataGridView Control
- 14.9 Hands-On Tutorial Creating a Search Form
- 14.10 The Query Builder
- 14.11 Hands-On Tutorial Creating a Look-up Table
- 14.12 Data Binding Properties of a ComboBox
Control - 14.13 In-Class Assignment
- 14.14 Summary
22Auto-Created Objects in the Component Tray
- Four objects were added to the Component tray
when we dragged the student table node from the
Data Sources Window onto Form1 - TableAdapter object
- Host for SQL queries
- Corresponding to each query, has a Fill method
that executes a SQL query - DataSet object
- Acts as an in-memory data repository
- Can have any number of DataTables
- DataTables are populated using a TableAdapter, by
means of results of SQL queries
23Auto-Created Objects in the Component Tray (cont.)
- BindingSource object
- Mediator between a Windows control and a DataSet
- BindingNavigator object
- Enables users to navigate through and manipulate
data on Windows forms with the help of a
ToolStrip control
BindingSource Object Work Diagram
24Overview
- 14.1 Introduction
- 14.2 Database Applications Overview
- 14.3 Hands-On Tutorial Creating a Simple
Database Application - 14.4 Auto-Created Objects in the Component Tray
- 14.5 Hands-On Tutorial Displaying Data in
Individual Windows Controls - 14.6 Hands-On Tutorial Binding Data to Existing
Controls - 14.7 Hands-On Tutorial Displaying Related Data
on a Windows Form - 14.8 DataGridView Control
- 14.9 Hands-On Tutorial Creating a Search Form
- 14.10 The Query Builder
- 14.11 Hands-On Tutorial Creating a Look-up Table
- 14.12 Data Binding Properties of a ComboBox
Control - 14.13 In-Class Assignment
- 14.14 Summary
25Setting the Controls to be Created
- How-to Display Data in Individual Windows
Controls - Add a new form, Form2, to the DatabaseConnectivity
application. - In the Data Sources Window, select the student
table node, and click the drop-down arrow to
select the Details option. The default is the
DataGridView control.
Selecting the Details Option for a Table Display
26Setting the Controls to be Created (cont.)
- Expand the tblStudent node in the Data Sources
Window. - Choose the controls for all the columns as shown
below.
Individual Displaying Controls for the Columns
of the Student Table
27Setting the Controls to be Created (cont.)
- Drag the tblStudent node from the Data Sources
Window onto Form2 to create individual data-bind
controls for each selected column. - These controls are accompanied by appropriately
titled Label controls.
Individual Controls Shown in Forms Design View
28Test the Application
- Set Form2 as the start-up form. Press Ctrl F5
to run the application. The first record
displayed is shown below. - Use the ToolStrip on top of the form to navigate
through the records. Edit the value of any field,
and click Save to test its functionality.
Student Table Displayed One Record at a Time
29Property Window Review
- Select the TextBox control for the Name field,
and navigate to its DataBindings property in the
Property Window. - Note that the Text property of the Name TextBox
is associated with the Name column from the
TblStudentBindingSource.
Data Binding Properties for the Name Columns
TextBox Control
30Overview
- 14.1 Introduction
- 14.2 Database Applications Overview
- 14.3 Hands-On Tutorial Creating a Simple
Database Application - 14.4 Auto-Created Objects in the Component Tray
- 14.5 Hands-On Tutorial Displaying Data in
Individual Windows Controls - 14.6 Hands-On Tutorial Binding Data to Existing
Controls - 14.7 Hands-On Tutorial Displaying Related Data
on a Windows Form - 14.8 DataGridView Control
- 14.9 Hands-On Tutorial Creating a Search Form
- 14.10 The Query Builder
- 14.11 Hands-On Tutorial Creating a Look-up Table
- 14.12 Data Binding Properties of a ComboBox
Control - 14.13 In-Class Assignment
- 14.14 Summary
31Adding a PictureBox Control
- How-to Bind Data to Existing Controls
- Continue with the Windows form created in the
previous hands-on tutorial. Drag-and-drop a
PictureBox control onto the right of the existing
controls. - Verify that the Image property of the PictureBox
control has the default value None.
Running Application with Data-bind PictureBox
Control
32Associating the Picture Column and Testing
- Drag-and-drop the Picture column under the
student table node from the Data Sources Window
onto the PictureBox control. - Press Ctrl F5 to run the application. Test the
data binding for PictureBox by navigating through
student records using the ToolStrip.
Running Application with Data-bind PictureBox
Control
33Property Window Review
- Re-open the Property Window for the PictureBox
control and review its Image property. - It is now associated with the Picture column from
the TblStudentBindingSource.
Data-bind Image Property for the PictureBox
Control
34Overview
- 14.1 Introduction
- 14.2 Database Applications Overview
- 14.3 Hands-On Tutorial Creating a Simple
Database Application - 14.4 Auto-Created Objects in the Component Tray
- 14.5 Hands-On Tutorial Displaying Data in
Individual Windows Controls - 14.6 Hands-On Tutorial Binding Data to Existing
Controls - 14.7 Hands-On Tutorial Displaying Related Data
on a Windows Form - 14.8 DataGridView Control
- 14.9 Hands-On Tutorial Creating a Search Form
- 14.10 The Query Builder
- 14.11 Hands-On Tutorial Creating a Look-up Table
- 14.12 Data Binding Properties of a ComboBox
Control - 14.13 In-Class Assignment
- 14.14 Summary
35Adding the Related Transcript Table
- How-to Display Related Data on a Windows Form
- In the Data Sources Window, expand the student
table node and select the transcript table node.
Drag-and-drop it onto the bottom of Form2.
Adding Related Tables from the Data Sources
Window
Component Tray
36Editing the Transcript DataGridView
- Select the transcript DataGridView and click its
smart tag to view the Tasks list. Select the Edit
Column option from the list to open the Edit
Columns dialog box.
Invoking DataGridViews Edit Columns Dialog Box
37Editing the Transcript DataGridView (cont.)
- Select the StudentID column and click Remove to
delete the column. - In general, we can use the Edit Columns dialog
box to edit properties of existing columns, such
as column heading, width, and more.
Removing StudentID Column from the DataGridView
Control
38Editing the Transcript DataGridView (cont.)
- Select the DataGridView and navigate to the
Property Window. - Select the AlternatingRowsDefaultCellStyle
property and click the Build button () to edit
the alternating cell style.
Styling Alternate Rows of a DataGridView Control
39Editing the Transcript DataGridView (cont.)
- Choose the BackColor and ForeColor properties in
the CellStyle Builder dialog box as shown below.
Setting BackColor and ForeColor Properties
40Testing the Application
- Press Ctrl F5 to run the application. Test the
parent-child relationship by navigating through
student records using the ToolStrip.
Running Application with Parent-Child
Relationship
41Property Window Review
- Select the TblStudentBindingSource object
(parent) from the Component tray and open the
Property Window. - Note that the DataSource property of this object
is set to the UniversityDataSet. - Also, the DataMember property is set to the
tblStudent data table.
DataSource Property of Parent BindingSource
42Property Window Review (cont.)
- Now select the TblTranscriptBindingSource object
(child) from the Component tray and open the
Property Window. - Note that the DataSource property of this object
is set to the TblStudentBindingSource. - Also, the DataMember property is set to
tblStudenttblTranscript, which is the name of the
Data Relation object that relates parent and
child tables.
DataSource Property of Child BindingSource
43Code Review
- Since we added one more table on the form, Visual
Studio added one more line of code. - Executes the appropriate SQL query to fill the
tblTranscript data table.
Form2_Load Event Populating the Transcript and
Student Tables
44Overview
- 14.1 Introduction
- 14.2 Database Applications Overview
- 14.3 Hands-On Tutorial Creating a Simple
Database Application - 14.4 Auto-Created Objects in the Component Tray
- 14.5 Hands-On Tutorial Displaying Data in
Individual Windows Controls - 14.6 Hands-On Tutorial Binding Data to Existing
Controls - 14.7 Hands-On Tutorial Displaying Related Data
on a Windows Form - 14.8 DataGridView Control
- 14.9 Hands-On Tutorial Creating a Search Form
- 14.10 The Query Builder
- 14.11 Hands-On Tutorial Creating a Look-up Table
- 14.12 Data Binding Properties of a ComboBox
Control - 14.13 In-Class Assignment
- 14.14 Summary
45DataGridView Control
- The DataGridView control is one of the most used
data controls - We can use it to
- Display data
- Format data
- Sort data
- Update and delete data
- Select and navigate through data records
- DataGridView Tasks
- We can use the smart tag to
- Access the DataSource property of the control
- Add a new column to the column collection
- Enable or disable edit, delete, and insertion
operations
46Sorting with DataGridView
- DataGridView controls may be sorted by clicking
any column heading in the grid - Click repeatedly to toggle sorting order
(ascending/descending) - A small triangular icon appears in the column
when sorted
Sorting Data by DeptID Column in Descending Order
47Data Binding
- Binding data to the DataGridView control is
intuitive and straightforward - Specify data source by setting the DataSource
property to a BindingSource - Set DataMember property for specific
tables/queries
DataSource and DataMember Properties of a
DataGridView Control
48DataGridView In Depth
- Additional properties
- BackColor, BackgroundColor, ColumnCount, Font,
ForeColor, Name, ReadOnly, RowCount, Visible,
Width
49Overview
- 14.1 Introduction
- 14.2 Database Applications Overview
- 14.3 Hands-On Tutorial Creating a Simple
Database Application - 14.4 Auto-Created Objects in the Component Tray
- 14.5 Hands-On Tutorial Displaying Data in
Individual Windows Controls - 14.6 Hands-On Tutorial Binding Data to Existing
Controls - 14.7 Hands-On Tutorial Displaying Related Data
on a Windows Form - 14.8 DataGridView Control
- 14.9 Hands-On Tutorial Creating a Search Form
- 14.10 The Query Builder
- 14.11 Hands-On Tutorial Creating a Look-up Table
- 14.12 Data Binding Properties of a ComboBox
Control - 14.13 In-Class Assignment
- 14.14 Summary
50Hands-On Tutorial Creating a Search Form
- Often we are not interested in viewing an entire
table of data - Prefer to display only the data that satisfies
some specified criteria - We can do this using search forms in a database
application - A parameterized query takes in some criteria as
parameters and retrieves records that satisfy the
criteria - Improve the efficiency of database applications
- Fetch only the portion of the data that interests
us
51Adding a Parameterized Query
- How-to Create a Search Form
- Add a form, Form3, to the DatabaseConnectivity
application. - Drag and drop tblStudent from the DataSources
Window to the form. This creates a DataGridView
control named TblStudentDataGridView. - Choose the Add Query option from the Tasks list
of the DataGridView.
Adding a Query to a TableAdapter Through
DataGridView
52Adding a Parameterized Query (cont.)
- This opens the Search Criteria Builder dialog
box. Name the new parameter query FillByDept.
Enter the SQL query as shown below in the Query
Text area to construct a parameterized query.
Adding Queries in Search Criteria Builder
Dialog Box
53Adding a Parameterized Query (cont.)
- Click the Query Builder button in the Search
Criteria Builder dialog box. - Click the Execute Query button to test the query.
Working with the Query Builder to Design SQL
Queries
54Adding a Parameterized Query (cont.)
- A Query Parameters dialog box opens. Test the
query with the example CISE for the DeptID
parameter value and click OK. - Preview the results of the query in the Query
Builder itself. Note that all the records that
are displayed have CISE as the DeptID. Click OK.
Assigning a Sample Value to a Query Parameter
55Adding a Parameterized Query (cont.)
- We have now added a parameterized query,
FillByDept, to the TblStudentTableAdapter. This
automatically creates the ToolStrip control for
DeptID input at the top of Form3. - We can also see that a ToolStrip control has been
added to the Component tray.
A ToolStrip Control for a Parameterized Query
56Preview Data for Newly Added Query
- Use the DataGridViews smart tag to view its
Tasks list, and choose the Preview Data option to
open a dialog box. - Choose the query FillByDept from the drop-down
list as shown below.
Selecting a Query in the Preview Data Dialog Box
57Preview Data for Newly Added Query (cont.)
- Provide the testing parameter for the query as
CISE and click Preview. The dialog box
resembles below.
The Preview Data Dialog Box in Action
58Testing the Application
- Set Form3 as the start-up form of the
application, and press Ctrl F5 to run the
application. - Test the search or filtering functionality by
entering different DeptIDs in the FillByDept
ToolStrip.
Running Form3 with the Search Functionality
59Code Review
- Open the Code Window for Form3 by double-clicking
on the form. - Note the Visual Studio auto-generated the Click
event. - Executes the FillByDept query of the
TblStudentTableAdapter and fills the tblStudent
data table of the UniversityDataSet.
Executing Parameterized SQL Statements
60Overview
- 14.1 Introduction
- 14.2 Database Applications Overview
- 14.3 Hands-On Tutorial Creating a Simple
Database Application - 14.4 Auto-Created Objects in the Component Tray
- 14.5 Hands-On Tutorial Displaying Data in
Individual Windows Controls - 14.6 Hands-On Tutorial Binding Data to Existing
Controls - 14.7 Hands-On Tutorial Displaying Related Data
on a Windows Form - 14.8 DataGridView Control
- 14.9 Hands-On Tutorial Creating a Search Form
- 14.10 The Query Builder
- 14.11 Hands-On Tutorial Creating a Look-up Table
- 14.12 Data Binding Properties of a ComboBox
Control - 14.13 In-Class Assignment
- 14.14 Summary
61The Query Builder
- The Query Builder dialog box helps us build SQL
queries - Divided into four horizontal segments (listed
from top to bottom) - Table Pane Displays and allows the addition or
deletion of DataTables and their relationships - Design Grid Specifies the sorting order, filter
criteria, group by, and output value for the
fields being displayed - SQL View Displays the SQL statement as we build
the query in the Design Grid - Preview Displays a preview of the query output
62Overview
- 14.1 Introduction
- 14.2 Database Applications Overview
- 14.3 Hands-On Tutorial Creating a Simple
Database Application - 14.4 Auto-Created Objects in the Component Tray
- 14.5 Hands-On Tutorial Displaying Data in
Individual Windows Controls - 14.6 Hands-On Tutorial Binding Data to Existing
Controls - 14.7 Hands-On Tutorial Displaying Related Data
on a Windows Form - 14.8 DataGridView Control
- 14.9 Hands-On Tutorial Creating a Search Form
- 14.10 The Query Builder
- 14.11 Hands-On Tutorial Creating a Look-up Table
- 14.12 Data Binding Properties of a ComboBox
Control - 14.13 In-Class Assignment
- 14.14 Summary
63Linking the Department Table
- How-to Create a Look-up Table
- Drag tblDepartment from the Data Sources Window
directly onto the DeptID ComboBox control on
Form2. - Note that the DataSource property of the DeptID
ComboBox control is set to TblDepartmentBindingSou
rce.
Creating a Department Look-up Table
Component Tray
64Linking the Department Table (cont.)
- Set the DisplayMember property of the DeptID
ComboBox control to Name and verify that the
ValueMemeber property is set to the DeptID
column. - The new Component tray objects will query and
bring the names of the departments as a list into
the DeptID ComboBox control.
65Testing the Application
- Set Form2 as the start-up form, and press Ctrl
F5 to run the application. - Navigate through the student records.
- Note that the ComboBox displays the department to
which the student belongs. - Use the drop-down arrow on the ComboBox to see
the list of all the departments.
Running Application with a Look-up Table
66Property Window Review
- Open the tasks list for the DeptID ComboBox
control. - Note the values for all properties of the
control.
Tasks for ComboBox with a Lookup Table
67Property Window Review (cont.)
- Open the Property Window for DeptID ComboBox
control and locate its Data Binding section. - Note the SelectedValue property value.
Property Window for DeptID ComboBox Control
68Code Review
- The auto generated code for the lookup table is
very simple. - The only addition to the code is a call to the
Fill method of TblDepartmentTableAdapter (lines
25-26).
Form2_Load Event Showing Fill Method for Look-up
Table
69Overview
- 14.1 Introduction
- 14.2 Database Applications Overview
- 14.3 Hands-On Tutorial Creating a Simple
Database Application - 14.4 Auto-Created Objects in the Component Tray
- 14.5 Hands-On Tutorial Displaying Data in
Individual Windows Controls - 14.6 Hands-On Tutorial Binding Data to Existing
Controls - 14.7 Hands-On Tutorial Displaying Related Data
on a Windows Form - 14.8 DataGridView Control
- 14.9 Hands-On Tutorial Creating a Search Form
- 14.10 The Query Builder
- 14.11 Hands-On Tutorial Creating a Look-up Table
- 14.12 Data Binding Properties of a ComboBox
Control - 14.13 In-Class Assignment
- 14.14 Summary
70Data Binding Properties of a ComboBox Control
- There are four main data binding properties of a
ComboBox
71Overview
- 14.1 Introduction
- 14.2 Database Applications Overview
- 14.3 Hands-On Tutorial Creating a Simple
Database Application - 14.4 Auto-Created Objects in the Component Tray
- 14.5 Hands-On Tutorial Displaying Data in
Individual Windows Controls - 14.6 Hands-On Tutorial Binding Data to Existing
Controls - 14.7 Hands-On Tutorial Displaying Related Data
on a Windows Form - 14.8 DataGridView Control
- 14.9 Hands-On Tutorial Creating a Search Form
- 14.10 The Query Builder
- 14.11 Hands-On Tutorial Creating a Look-up Table
- 14.12 Data Binding Properties of a ComboBox
Control - 14.13 In-Class Assignment
- 14.14 Summary
72In-Class Assignment
- Develop an application that displays the list of
faculty from the University database - Display on both
- DataGridView control
- Individual controls
- Show a faculty picture in the PictureBox control
- Add a look-up table for the DeptID in an
individual control on the form - Add search functionality to the form to display
only those faculty records for which - Query The salary is greater than the
user-entered salary value and the department is
the department specified by the user. - Hint Add a parameter query to the TableAdapter
with two parameters
73Overview
- 14.1 Introduction
- 14.2 Database Applications Overview
- 14.3 Hands-On Tutorial Creating a Simple
Database Application - 14.4 Auto-Created Objects in the Component Tray
- 14.5 Hands-On Tutorial Displaying Data in
Individual Windows Controls - 14.6 Hands-On Tutorial Binding Data to Existing
Controls - 14.7 Hands-On Tutorial Displaying Related Data
on a Windows Form - 14.8 DataGridView Control
- 14.9 Hands-On Tutorial Creating a Search Form
- 14.10 The Query Builder
- 14.11 Hands-On Tutorial Creating a Look-up Table
- 14.12 Data Binding Properties of a ComboBox
Control - 14.13 In-Class Assignment
- 14.14 Summary
74Summary
- Database applications can be roughly divided into
three types - Display-oriented
- Transaction-oriented
- Communication-oriented
- The database application development process can
be summarized into the following steps - Connect to the database using a Connection object
- Fetch data using database queries in the
TableAdapter object - Temporarily store the results in a DataSet object
- Display data on a Windows form by binding Windows
controls to a DataSet - Edit data in the application
- Save data back in the database
75Summary (cont.)
- We walked through the process of building a
simple database application displaying the
student table fields on the DataGridView control.
- We reviewed the auto-generated code and auto-set
properties by Visual Studio. - We also showed how the same data and columns can
be displayed in individual controls on a form. - We then extended this application to bind the
PictureBox to the picture column of the student
table. - We further enhanced the application by adding a
related transcript table to the form. - Used to display the courses and grades for each
student record as we navigate through them.
76Summary (cont.)
- We have added a search or filter function to the
form. - Displays only those student records belonging to
the department specified by us in the ToolStrip. - Finally, we have added a look-up table for the
department field of the student table. - Allows us to list all the department names via a
drop-down list.