IT8118 Midterm Exam Instructions and Procedures
IT8118 Midterm Exam Instructions and Procedures
Complete the Moodle quiz using Safe Exam Browser. Note: there is a time limit of 15 minutes for this at the
beginning of the exam.
From your H:\ Drive, Open the folder with the practical exam package, then double click Chinook.sln. If
prompted, open the solution using Visual Studio 2022.
Open the project called ChinookBusinessObjects inside the Visual Studio Solution. Complete the project
according to the instructions in the following pages.
Open the project called Chinook inside the Visual Studio Solution. Complete the project according to the
instructions in the following pages.
Complete all tasks as per the instructions below and save all your work.
At the end of the exam, your entire work (which includes the .sln file, and both projects) as well as the cover
page with your Name and Student ID should be on the H: Drive.
Reminder: Take constant backups of your work. Your uncompressed folder inside H:\ Drive will be considered
your final submission.
Page 1 of 6
Practical Exam
IMPORTANT NOTES
• Make sure you have installed the Chinook database on your local PC, using the ChinookDatabaseScript.sql
file. Select (localDB)\MSSQLLocalDB server or host when installing the database.
Track
TrackId
Name Album
Genre AlbumId AlbumId
GenreId GenreId Title
Name UnitPrice ArtistId Artist
ArtistId
FirstName
LastName
• Before you start coding you MUST CHANGE the connection string in the class library to the correct
server/host and database on your local machine.
• Note that if you forget this step the existing database connection string will not work and thus you will not
be able to test your code.
• You can refer to the General Troubleshooting Tips at the end of this file in case you faced any unexpected
errors.
Open the project called ChinookBusinessObjects inside your Visual Studio Solution. This is a Class Library
project containing existing working code.
• Set the connection string code that already exists in the class library to connect to the Chinook
database on your local PC’s local server. [8 marks]
Do not change any existing code. Your task is to add 1 new property and an override as described below,
which will later be used in a desktop Forms application in Question 2.
• In Artist entity, and add a new Property called FullName, which will concatenate and return the
FirstName and LastName. [14 marks]
• In Genre entity, and add a ToString override, to display the Genre name by default [8 marks]
− The Chinook project contains 2 forms with controls. You will not need to add any new controls to the
forms or change the existing controls.
− The task is to successfully implement the logic of the interface described below by making use of the
ChinookBusinessObjects Class Library.
− You must make use of the new Property in the Class Library which you created in Question 1.
− Your solutions should work and must be coded according to professional coding standards with a high
level of code quality.
Page 2 of 6
Instructions:
• Make sure to include any references or class level variables you need
• On form load, you need to:
o Populate the Drop Down List with data from the database. Make sure to display the FullName
of the Artist.
o Populate all Albums in the Data Grid View (considering a reusable approach), using Projection
to have the same column names and values as displayed in the screenshot below [AlbumID,
Title, Artist, TracksCount], where Artist will show the full name, and TracksCount will calculate
how many tracks are inside the album.
• When the user clicks Filter, the grid view is filtered (considering a reusable approach) either by:
o Name: find the albums that contain the text written in their title
Page 3 of 6
o Or, by Artist: find the albums that are published by the selected artist
o When the user clicks Reset, all filter controls will be emptied, and gridview reset to show all
albums.
• Implement the View Tracks button which, when pressed, passes the selected Album to the second
form (frmTracks) using the best method of your choice.
• Include error handling / validations and follow best coding practices.
• Make sure to include any references or class level variables you need, and to retrieve the Album
selected and passed from the previous form
• On form load, you need to:
o Display the selected Album Name, and Artist Name at the top
Page 4 of 6
o Populate all Tracks in the Data Grid View for the selected Album considering a reusable
approach (No need for projection. You can simply hide columns 2,3,5 from the grid view after
you bind the data source)
o Calculate the total price for the album, by adding the UnitPrice of all tracks inside it.
o If no errors, insert a new Track to the same Album selected, show success message, and
refresh the grid view as well as the total price (considering a reusable approach):
o Refresh the gridview as well as the total price (considering a reusable approach)
• Include error handling / validations and follow best coding practices.
Page 5 of 6
Appendix: General Troubleshooting Tips
If you face any issues while working on your project, please consider the following troubleshooting tips:
1. If you got any error messages related to Resx files blocked, you will have to manually unblock all .Resx
files in your project (by opening the project in file explorer > right click the .Resx files, Properties > tick
Unblock > Apply/Ok) to resolve the issue.
2. If you receive any error message related to Database connection issue, database does not exist, or you
do not have permission to access the Database, check that you have executed the database from the
“.sql” file provided with the exam package, verify it exists from SQL Server Database Explorer view, and
verify that your connection string is correct.
3. If you got any error messages related to the Form Designer cannot be loaded, Right Click on the Tab >
close all tabs in Visual Studio:
Note: Never change or update the Designer.cs file of any form otherwise the form can get corrupted.
4. Optionally, after you are done with the exam, to make your overall Project files size smaller:
Before you close Visual Studio, Right click on your solution from Solution Explorer > Clean Solution.
Page 6 of 6