Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# Error 'No overload for method 'getData' takes '1' arguments

Tags:

c#

I am getting the following error:

Error 49 No overload for method 'getData' takes '1' arguments 

With this method on the 5th line.

    [WebMethod]
    public string getVerzekerde(int bsn)
    {
        ZDFKoppeling koppeling = new ZDFKoppeling();
        return koppeling.getData(bsn);             
    }

The getData method looks like this:

    public string getData(int bsn)
    {         
        using (new SessionScope())
        {
            ZorgVerzekerde verzekerde = PolisModule.GetVerzekerde(bsn);
            return "Verzekerde " + verzekerde.Naam;          
        }     
    }

I realy don't understand what is going wrong here.. The description of this error on the msdn site didn't help me.. http://msdn.microsoft.com/en-us/library/d9s6x486%28VS.80%29.aspx

Someone who has a solution?

like image 787
Rick Avatar asked Sep 21 '09 10:09

Rick


2 Answers

Yeah; somehow you're compiling against a different version of that class. Do a clean build, and double check your references.

like image 65
Noon Silk Avatar answered Sep 21 '22 06:09

Noon Silk


Put an error in the GetData() method, then do a full build and confirm that the compiler find the errors. You may be editing the wrong file if you have more then one copy of the source code on your machine, and this will show you if you are.

Also try renaming the ZDFKoppeling class without updating getVerzekerde() and check you get a compiler error. If not you are not picking up the changed class for some reason.

If the above does not give a compiler error, try a rebook, as a process my have the dll locked, and also try a complete rebuild.

These problems normally turn out to be very simple once you have tracked them down. But get take forever to track down.

If another programmer works in the same office, ask for his/her help, as often a 2nd set of eye on the machine can find it quickly.

(I am assuming that GetData() is defined in the ZDFKoppeling class, not some other calss)

like image 24
Ian Ringrose Avatar answered Sep 17 '22 06:09

Ian Ringrose