Programming Lab 1: Employee Records Viewer, due Thursday, 9/21
Objective: To write a program that displays the results of a query, using objects that are created in
code
Here are the details and rules:
- Write a query to select the fields ID, FirstName, LastName, DepartmentName, and
Salary from tblEmployee joined with tblDepartment. This query should not be saved in the database;
you'll simply execute the query's text via your VB code.
- Write a program to view the query results with a GUI like shown here:
- You must have "Option Strict On" at the top of each module
- All the objects you use to execute the query and retrieve its results should be created in code that
you write. Don't drag and drop from the data source to create the Connection object or such.
- The "Next" button should work as expected: moving forward to the next record in the query results.
No changes are to be saved.
- The text for your text boxes can be set in code; you don't have to use DataBindings (it's easier not
to use DataBindings for this one).
- Hint: the best way to do this program is to use a SqlCommand object, on which you execute the
ExecuteReader method, and use the resulting SqlDataReader object to get your data, putting it into the
right textboxes in the "Next" button's event handler.
- When turning in your homework, simply turn in the code for the form. Print this text or e-mail it to
cpersiko@ccsf.edu
Return to main CS 112D page