473,406 Members | 2,336 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

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

3
No overload for method 'Question' takes '0' arguments...plz reply me
Sep 19 '07 #1
4 12810
pbmods
5,821 Expert 4TB
Heya, kj123.

Changed thread title to better describe the problem (threads whose titles do not follow the Posting Guidelines actually get fewer responses).

Sounds like you're trying to call a method with zero arguments... but that method requires at least one argument.
Oct 23 '07 #2
Plater
7,872 Expert 4TB
No overload for method 'Question' takes '0' arguments...plz reply me
Try LOOKING at the constructor for that class (use inteli-sense if you need to) and see what argument it is looking for.
Oct 23 '07 #3
mhinra
1
Assuming for the briefest of moments that kj123 didn't post his message just so he could have someone read it back to him...

You might get that error on a class name if you are inheriting from a parent class which does not have a default constructor. So, if you had code like:

public class foo {
public foo(int i)
{ }
}

public class bar : foo {

}

You would get that error on the word 'bar' in your class declaration. My assumption (although I don't know this for a fact) is that the compiler is attempting to create an implicit zero argument constructor for 'bar' which calls the parent's implicit zero argument constructor. The only problem is that if you add a constructor to 'bar' (thus presumably preventing the compiler from generating an implicit zero argument one), you still get the error.

So, not really sure why you get this problem. However, creating a zero argument constructor for 'foo' does make the error go away. Since 'bar' is a child class, you can even make that constructor protected to avoid having folks outside the inheritance tree call it.

If anyone does know why the compiler is generating this sort of error, I'd love to hear about it.
Nov 10 '07 #4
Plater
7,872 Expert 4TB
It's also not exactly a difficult problem to self diagnose.
That's why they make these error messages, they're fairly clear.

That being said, the inheritance comment is a nice bit of depth that might not normally be checked for.
Nov 12 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: bsaucer | last post by:
I am creating a class with operator overloads. It makes references to another class I've created, but do not wish to modify. I try to overload an operator having arguments having the other class...
1
by: Nimmi Srivastav | last post by:
There's a rather nondescript book called "Using Borland C++" by Lee and Mark Atkinson (Que Corporation) which presents an excellent discussion of overloaded new and delete operators. In fact there...
10
by: Benny Raymond | last post by:
I'm trying to change the way a treeview works just a bit, i'm pretty new to C# and now i'm running into overloading. I tried the following code and it's yelling at me saying that no overload...
6
by: multisync | last post by:
I'm getting the following error: Overload resolution failed because no accessible 'Add' can be called with these arguments: 'Public Sub Add(item As System.Web.UI.WebControls.ListItem)': Value of...
1
by: Simon Porter | last post by:
Hi, I'm completely stuck with some example code I'm trying to use. The code is from http://msdn2.microsoft.com/en-us/library/system.net.networkinformation.ping.aspx I would have thought to...
4
by: JamesG | last post by:
Hi, I'm new to C-Sharp (as of today) and i'm struggling to implement a SOAP client to a PHP5 web service. I have added the Web Reference (do I also need to use wsdl.exe and compile the .dll, and...
3
by: CrazyDrummer | last post by:
Hi all, I am a newbie of C#, when i am trying the code in the following topic http://msdn2.microsoft.com/en-us/library/aa302405.aspx#Mtps_DropDownFilterText "C:\Visual Studio...
11
by: Gary James | last post by:
I'm using an object data type variable to pass a numeric value (Int, Float, Double, etc) to a function that returns a formatted string. However, nullable types do not provide an overridden...
3
by: Mucahit ikiz | last post by:
Can you help me please, I have this error message "No overload for method 'GetDataByClassType'takes '1' arguments" private void button7_Click(object sender, EventArgs e) { string...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.