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:
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.