There is no argument given that corresponds to the required formal parameter - .NET Error
Solution 1:
In the constructor of
public class ErrorEventArg : EventArgs
you have to add "base" as follows:
public ErrorEventArg(string errorMsg, string lastQuery) : base (string errorMsg, string lastQuery)
{
ErrorMsg = errorMsg;
LastQuery = lastQuery;
}
Solution 2:
You have a constructor which takes 2 parameters. You should write something like:
new ErrorEventArg(errorMsv, lastQuery)
It's less code and easier to read.
EDIT
Or, in order for your way to work, you can try writing a default constructor for ErrorEventArg which would have no parameters, like this:
public ErrorEventArg() {}
Solution 3:
I got the same error but it was due to me not creating a default constructor. If you haven't already tried that, create the default constructor like this:
public TestClass()
{
}