Results 1 to 3 of 3

Thread: No overload for method error

  1. #1

    Thread Starter
    Registered User
    Join Date
    Mar 2002
    Location
    Nashville, TN
    Posts
    103

    Angry No overload for method error

    I am a new C# developer (making the switch from VB but have a strong understanding of .NET and a basic understanding of C++). I am using the ADO command.execute method and I keep getting the following error:

    No overload for method 'Execute' takes '0' arguments

    I know the error means I haven't passed in all the arguments for the execute method. However in both C++ and VB, the arguments for the Execute method are optional and you can execute the method by simply saying:

    cmd.Execute(); //cmd is ADODB.Command

    For the life of me, I cannot figure out how to get it to just take the default values for the execute method (I know this is a limitation in C#). Any ideas?

  2. #2
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    C# doesnt allow optional arguments.
    \m/\m/

  3. #3
    Member
    Join Date
    Sep 2002
    Location
    London
    Posts
    63
    Yeah, I learned that the hard way too, after switching from VB to C#.

    But got used to it now.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width