c# Error CS 7036

Eli007 1 Reputation point
2022-09-16T09:41:51.893+00:00

Hi, I got this error for this code :
#region Database Communication.
public void DataMaintenance(Employee anEmp)
{
//perform a given database operation to the dataset in meory;
**employ
eeDB.DataSetChange(anEmp);//calling method to do the insert
employees.Add(anEmp);//
}
//***Commit the changes to the database
public bool FinalizeChanges(Employee employee)
{
//***call the EmployeeDB method that will commit the changes to the database
return employeeDB.UpdateDataSource(employee);

    }  
    #endregion  

Severity Code Description Project File Line Suppression State
Error CS7036 There is no argument given that corresponds to the required formal parameter 'operation' of 'EmployeeDB.DataSetChange(Employee, DB.DBOperation)' GoodFoodSystem C:\Users\patiance\OneDrive\Desktop\INF2011\startingFile-1\GoodFoodSystem\GoodFoodSystem\GoodFoodSystem\BusinessLayer\EmployeeController.cs 41 Active

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,207 questions
Azure Stack Hub
Azure Stack Hub
An extension of Azure for running apps in an on-premises environment and delivering Azure services in a datacenter.
179 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 56,931 Reputation points
    2022-09-16T15:26:18.403+00:00

    the error is pretty clear. EmployeeDB.DataSetChange() requires two parameters, and your code passes one,

    1 person found this answer helpful.
    0 comments No comments