Cookie Sales Exercise 11-3 Zak's Programming with Microsoft Visual Basic 2019/2022

Описание к видео Cookie Sales Exercise 11-3 Zak's Programming with Microsoft Visual Basic 2019/2022

In this exercise, you create an application that keeps track of cookie sales. Create a Windows Forms application. Use the following names for the project and solution, respectively: Sales Project and Sales Solution. Save the application in the VB9e\Chap11 folder.

Figure 11-64 shows the Sales table contained in the VB9e\Chap11\Databases\Cookies.mdf file. The table contains the numbers of boxes of cookies sold in each of three weeks. The Week field is an auto-numbered field. Open the Data Sources window and click Add New Data Source to start the Data Source Configuration Wizard. Connect the Cookies.mdf file to the application. Include the entire Sales table in the dataset.

Set the Cookies.mdf file’s Copy to Output Directory property to “Copy if newer.”

Create a data form for the user to enter the sales information. (The Week field’s data should appear in a label control.) Lock the controls on the form and then set the tab order.

Rename the text boxes as follows: txtChocolate, txtPeanut, and txtPecan.

Each text box should accept only numbers and the Backspace key. Create an event-handling Sub procedure that will handle the three event procedures.

Enter an appropriate Try…Catch statement in the SalesBindingNavigatorSaveItem_Click procedure.

Save the solution and then start the application. Change the Peanut Butter sales for Week 1 to 125. Then, enter the following record for Week 4: 100, 100, and 100. Save the changes.

Stop the application and then start it again to verify that the changes you made were saved.

Комментарии

Информация по комментариям в разработке