Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this exercise, create a form that lets the user display an invoice, along with the line items for that invoice. Create a parameterized query

In this exercise, create a form that lets the user display an invoice, along with the line items for that invoice.

image text in transcribed

  1. Create a parameterized query named FillByInvoiceID that gets the invoice data for a specific invoice ID, and modify the Toolstrip control thats generated so it appears as shown above.
  • Simplify the code that was generated for the Click event handler of the button on the Toolstrip control.
  1. Create a parameterized query for the DataGridView control named FillByInvoiceID that gets the line items for a specific invoice ID, and delete the ToolStrip and event handler that are generated.
  2. Modify the code in the event handler for the Click event of the FillByInvoiceIDToolStripButton so it gets the line items for the selected invoice.
  • Be sure to check that an invoice with the invoice ID that was entered was found before you get the line items.
  • If an invoice is not found, display an appropriate error message.

Complete the application

  1. Add a catch block to the try-catch statement in the Click event handler to catch the exception that is thrown if the invoice ID is not an integer.
  • Add a using directive for the System.Data.SqlClient namespace.
  • Add another catch block that catches a SqlException.
O Invoice Line Items Invoice ID: 46 Get Invoice Invoice Date: 11/13/2015 $216.50 Product Total: Sales Tax $16.24 $7.50 Shipping: Invoice Total: $240.24 Product Code A46V DB2R Quantity 1 Unit Price $57.50 $45.00 $57.50 Item Total $57.50 $45.00 1 SQ12 1 $57.50 VB 15 $56.50 1 $56.50 O Invoice Line Items Invoice ID: 46 Get Invoice Invoice Date: 11/13/2015 $216.50 Product Total: Sales Tax $16.24 $7.50 Shipping: Invoice Total: $240.24 Product Code A46V DB2R Quantity 1 Unit Price $57.50 $45.00 $57.50 Item Total $57.50 $45.00 1 SQ12 1 $57.50 VB 15 $56.50 1 $56.50

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Accounting questions

Question

Which are non projected Teaching aids in advance learning system?

Answered: 1 week ago

Question

Describe a persuasive message.

Answered: 1 week ago

Question

Identify and use the five steps for conducting research.

Answered: 1 week ago

Question

List the goals of a persuasive message.

Answered: 1 week ago