PDA

Click to See Complete Forum and Search --> : No overload for method error


smcgarry
Mar 17th, 2003, 04:27 PM
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?

PT Exorcist
Mar 19th, 2003, 05:50 PM
C# doesnt allow optional arguments.

Genie
Mar 21st, 2003, 05:10 AM
Yeah, I learned that the hard way too, after switching from VB to C#.

But got used to it now.