Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
image text in transcribed
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Shamkant B. Navathe

7th Edition Global Edition

1292097612, 978-1292097619

More Books

Students also viewed these Databases questions

Question

Apply your own composing style to personalize your messages.

Answered: 1 week ago

Question

Format memos and e-mail properly.

Answered: 1 week ago