My constructor code in “FileData.cs” file:
public FileData(BatchData batch)
{
this._batch = batch;
}
I want to access the properties from the “FileData.cs” file. So, I used the following code:
FileData fd = new FileData();
It shows the error message as “Constructor does not take 0 arguments”. I don’t know how to access the properties from the class. Provide me a solution. Thanks.
You don’t have a default constructor. You must include one as the compiler doesn’t generate one by default.
Basically since you defined an explicit constructor with an argument, the compiler doesn’t generate a default one, hence your error.
Or: