Answered step by step
Verified Expert Solution
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.
- 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.
- 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.
- 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
- 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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started