Question: 30 Extra exercises for Murach's Visnal Basic 2015 Extra 16-1 Write the code for a Product Maintenance application In this exercise, you'll use ADO.NET to

 30 Extra exercises for Murach's Visnal Basic 2015 Extra 16-1 Write
the code for a Product Maintenance application In this exercise, you'll use
ADO.NET to write the data access code for an application that lets

30 Extra exercises for Murach's Visnal Basic 2015 Extra 16-1 Write the code for a Product Maintenance application In this exercise, you'll use ADO.NET to write the data access code for an application that lets the user add, modify, and delete products. Desiption Price Murach's ASP NET 46 Wieb Pogranming with Cat 201 Modity Product Code AC Descrption Price57.5000 Open the project and add a class that gets a connection to the database 1. Open the ProductMaintenance project in the Extra Exercises Chapter 16 ProductMaintenance directory. This project contains the two forms for the application, the Product and Validator classes, and the MMABooks.mdf database file. 2. Add a public class named MMABooksDB to the project. Then, add a shared method named GetConnection that creates an SqlConnection object for the MMABooks database and then returns that connection. For this to work, you'll need to add an Imports statement for the System.Data.SqlClient namespace at the beginning of the class. Write the code to retrieve a product 3. Add another public class named ProductDB to the project, and add Imports statements for the System.Data and System.Data.SqlClient namespaces to this class. 4. Add a shared method named GetProduct to the ProductDB class. This method should receive the product code of the product to be retrieved, and it should return a Product object for that product. If a product with the product code isn't found, this method should return Nothing. Place the code that works with the database in the Try block of a Try...Catch statement, include a Catch block that catches and then throws any SqlException that occurs, and include a Finally block that closes the connection

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!