Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hello. I'm having a little bit of trouble understanding what I'm doing wrong. Based on question 1, my code isn't executing correctly. I'm receiving the
Hello. I'm having a little bit of trouble understanding what I'm doing wrong. Based on question 1, my code isn't executing correctly. I'm receiving the following errors How would I go about fixing it?
- Error CS1501: No overload for method 'FillByInvoiceID' takes 2 arguments
Question 1:
Create a parameterized query named FillByInvoiceID that gets the invoice data for a specific invoice ID, and modify the Toolstrip control that's generated so it appears as shown above.
My Code:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.Data.SqlClient; namespace InvoiceLineItems { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void fillByInvoiceIDToolStripButton_Click(object sender, EventArgs e) { try { int InvoiceID = Convert.ToInt32( invoiceIDToolStripTextBox.Text); this.invoiceLineItemsTableAdapter.FillByInvoiceID( this.MMABooksDataSet1.InvoiceLineItems, InvoiceID); if (invoiceLineItemsBindingSource.Count > 0) this.invoicesTableAdapter.FillByInvoiceID( this.MMABooksDataSet1.Invoices, InvoiceID); else MessageBox.Show("No invoice found with this ID. " + "Please try again.", "Invoice Not Found"); } catch (FormatException) { MessageBox.Show("Invoice ID must be an integer.", "Entry Error"); } catch (SqlException ex) { MessageBox.Show("Database error # " + ex.Number + ": " + ex.Message, ex.GetType().ToString()); } } } }
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