There is no argument given that corresponds to the required formal parameter - .NET Error

后端 未结 5 1097
迷失自我
迷失自我 2020-11-29 11:26

I have been re-factoring one of my old MSSQL Connection helper library and I got the following error:

Severity Code Description Project File Li

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-29 11:56

    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() {}
    

提交回复
热议问题