Use Programming Challenge 4 from Chapter 1 as a starting point for this programming challenge. In this version, create a database containing the following tables:

  • Prices (ticker symbol, price)—holds the current price of each investment, identified by a unique ticker symbol.
  • Investments (ID, ticker symbol, InvestmentType, price per share, purchase date, num- ber of shares).

Choose column types that seem appropriate to you. The InvestmentType column should contain an integer that matches one of the enumerated InvestmentType values already defined in your program.

Create a DataSet that contains TableAdapters for the Prices and Investments tables. The existing classes named Investment and PriceType will exist as middle-tier classes.

When the user clicks the Confirm button, shown in Figure 5-34, collect the data from the form and call the Insert method in the Investment class, which will, in return, call the Insert method in the InvestmentTableAdapter class. In that way, the form’s information will be inserted into the database. Then when the user clicks the Show list button, another form, shown in Figure 5-35, displays the current list of investments in a DataGridView control. See image. See next image.

Academic Honesty!
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.