This assignment requires you to write the necessary code to accomplish the following requirements in a single C# graphical user interface application: Your company has once again accepted a request to write a program for the gifted students of the Brain Readiness Academic Training School (BRATS). The BRATS would like to have a program that will display all the presidential candidates that have ran for the office of President of the United States since 1789. They would also like the program to have the capability to search the database for a candidate and return the year(s) they have run. They have supplied your company with a Microsoft Access Database that contains a table named tblCandidates. The table's fields include ID, ElectionYear, Candidate, CadidateParty, WinningCandidate, WinningCadidateParty. Since they wish to use this program year after year and there will be future elections they have asked that the program is written in such a way that the only thing that should need updating is the database to keep the program current. Your supervisor has assigned you to write the program.
The main form should be titled Candidates - XXX (replace the XXX with your initials) and should contain the following
A listbox with a vertical scrollbar that displays a list of election years starting with the year of 1789
A second listbox with no scroll bars that displays a list of candidates for the year selected in the first list box
Read only textboxes that will display all the fields of the selected candidate as well as one that displays the number of candidates per year as they are selected
The appropriate labels for each of the above controls
A Search button
An Exit button
The search form should be titled Search - XXX (replace the XXX with your initials) and should contain the following
Read only textbox that will displays the number of candidates found based on the search criteria
A data grid view box that only displays a list of candidates and election years based on the search criteria entered in the textbox
The appropriate labels for each of the above controls
A close button
Write a query in the ".xsf file that:
Will query the database and extract the candidates of a selected year
Will query the database and extract the number of candidates of a selected year
Will query the database and extract the candidates and year of a searched for candidate
Will query the database and extract the number of candidates found that meet the search criteria
Write code in the main form that:
Fills the first listbox with the appropriate years (Most current year at the top of the list)
Allows the user to scroll through the first listbox to select a year
Allows the user to then scroll through the second listbox to select a candidate
Displays the selected candidate's information in the textboxes
Display the number of candidates found in the selected year in a textbox
Displays the Search form when the Search button is pressed
Write code in the Search form that:
Fills the data grid view box as the user enter the search criteria in the textbox
Display the number of candidates found in the based on the search criteria in a textbox
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference
and should not be submitted as is. We are not held liable for any misuse of the solutions.
Please see the frequently asked questions page
for further questions and inquiries.
Kindly complete the form.
Please provide a valid email address and we will get back to you within 24 hours.
Payment is through PayPal, Buy me a Coffee
or Cryptocurrency.
We are a nonprofit organization however we need funds to keep this organization operating
and to be able to complete our research and development projects.