Last post Mar 25, 2019 02:55 AM by Wei Zhang
Mar 23, 2019 01:06 PM|sathyaav|LINK
I am try to learn asp.net. While enabling the fields I get No overload for method ' output' takes 21 argument in asp.net project. Is there any limitation in arguments length.
Just a check. Kindly clarify. the error is in the below link.
No overload for method 'output' takes 21 arguments"
Mar 23, 2019 01:14 PM|mgebhard|LINK
You misunderstand the error. The error means you are trying to pass 21 arguments to a method that does not have a definition with 21 parameters.
public void MyMethod(int param0, int param1, int param2)
MyMethod(0, 1, 2, 3)
The C# programming guide covers the fundamentals and term definitions.
Mar 23, 2019 02:01 PM|DA924|LINK
You are passing either too many parameters to the method, or you are not passing enough parameters to the method.
It could also be that you a looking at the wrong signature of the method too that can have multiple signatures implemented by overloads, which you should be able to see when you hover over a method with the mouse pointer when trying to code for the method's
usage as Visual Stuido displays the overloads.
Mar 25, 2019 02:55 AM|Wei Zhang|LINK
According to the error code, you haven't provide enough parameters for your method. Else if you want to set the length of parameter, you could use the size property of parameter s.Here is the code, I hope it could help you.
static void CreateSqlParameterSize()
string description = "12 foot scarf - multiple colors, one previous owner";
SqlParameter parameter = new SqlParameter("Description", SqlDbType.VarChar);
parameter.Direction = ParameterDirection.InputOutput;
parameter.Size = description.Length;
parameter.Value = description;