I dont know what to do to fix this What does the error at the end of this mean.
ID: 3576600 • Letter: I
Question
I dont know what to do to fix this
What does the error at the end of this mean.
I am using a database table with a query named maxPaid. I want to display the max paid person in the table.
Here is my code but i keep getting an error. THIS IS C#.
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;
namespace Highest_and_Lowest_Pay_Rate
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void employeeBindingNavigatorSaveItem_Click(object sender, EventArgs e)
{
this.Validate();
this.employeeBindingSource.EndEdit();
this.tableAdapterManager.UpdateAll(this.personnelDataSet);
}
private void Form1_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'personnelDataSet.Employee' table. You can move, or remove it, as needed.
this.employeeTableAdapter.Fill(this.personnelDataSet.Employee);
}
private void highestPaidButton_Click(object sender, EventArgs e)
{
decimal maxPaid;
maxPaid = (decimal)this.employeeTableAdapter.maxPaid(); //THE ERROR OCCURS ON THE SECOND maxPaid();
MessageBox.Show("The highest paid employee is " + maxPaid.ToString("c"));
}
private void lowestPaidButton_Click(object sender, EventArgs e)
{
this.employeeTableAdapter.maxPaid(this.personnelDataSet.Employee);
}
private void exitButton_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
I have a database with a table and my query is maxPaid -
SELECT MAX([Hourly Pay]) AS MAX_PAY
FROM Employee
Error CS7036 There is no argument given that corresponds to the required formal parameter 'dataTable' of 'EmployeeTableAdapter.maxPaid(PersonnelDataSet.EmployeeDataTable)' Highest and Lowest Pay Rate c:usersuserdocumentsisual studio 2015ProjectsHighest and Lowest Pay RateHighest and Lowest Pay RateForm1.cs 38 Active
Explanation / Answer
This error is causing because your base class constructor expecting some value, where you are
passing empty parameteres.
To fix this issue call this way...
decimal maxPaid;
maxPaid = (decimal)this.employeeTableAdapter.maxPaid(this.personnelDataSet.Employee);
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.