473,799 Members | 3,638 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C# function parameters total size limit?

I have a situation when calling a constructor with a lot of parameters.
In the following code, I create a System.Data.Dat aTable instance.
I run this code step by step in debug mode and I have lpDataTable.Row s in
the Watch window.

The problem is that in the watch window, lpDataTable.Row s display "error:
cannot obtain value" instead of "{System.Data.D ataRowCollectio n}".

This happen only when I call the Class2 constructor with 33 string
parameters. Calling it with 32 parameters will not cause this.
lpClass2 = new
Class2("","","" ,"","","","","" ,"","","","","" ,"","","","","" ,"","","","","" ,
"","","","","", "","","","","") ; is placed after lpDataTable = new
DataTable();
but it's presence is enought to cause lpDataTable.Row s to display "error:
cannot obtain value" in the watch window.

To reproduce that behavior, copy/paste the following code as a new c#
console project and add lpDataTable.Row s as a debug watch.
You will see lpDataTable.Row s "error: cannot obtain value"
Then call the Class2 Constructor with 32 parameters instead of 33, and it
works well.

What's going on there?

Thank
using System;
using System.Data;

namespace CrazyProject
{
class Class1
{
static void Main(string[] args)
{
Class2 lpClass2;
DataTable lpDataTable;

lpDataTable = new DataTable();

//32 string parameters
lpClass2 = new
Class2("","","" ,"","","","","" ,"","","","","" ,"","","","","" ,"","","","","" ,
"","","","","", "","","","","") ;

}
}

class Class2
{

public Class2(string p000,string p001,string p002,string p003,string
p004,string p005,string p006,string p007,string p008,string p009,string
p010,string p011,string p012,string p013,string p014,string p015,string
p016,string p017,string p018,string p019,string p020,string p021,string
p022,string p023,string p024,string p025,string p026,string p027,string
p028,string p029,string p030,string p031){}

public Class2(string p000,string p001,string p002,string p003,string
p004,string p005,string p006,string p007,string p008,string p009,string
p010,string p011,string p012,string p013,string p014,string p015,string
p016,string p017,string p018,string p019,string p020,string p021,string
p022,string p023,string p024,string p025,string p026,string p027,string
p028,string p029,string p030,string p031,string p032){}

}
}

David Laplante
dl*******@cimte ch.ca
Nov 15 '05 #1
0 1197

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
4966
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my webserver runs that part of the script (see attached file, snippet.php), though, it doesn't go through. I don't get an error message or anything...it just returns a "1" (whereas it should return a "0") as far as I can tell. I have read the PHP...
0
3453
by: Mike Copeland | last post by:
In the following code I am calculating 2 values when the "Compute Distance" button is pressed. I would like to find a way to "return" both value to the form so I can show both when the calculation is made. (one is merely the doubling of the computed result.) I have cobbled this form from several places, and I don't remember enough of HTML or JavaScript to know where to seek additional information. The code below does the calculation,...
3
1675
by: Bryan Parkoff | last post by:
Do C/C++ Compiler allow function to contain more than 8 parameters? I checked MS Visual C++ 6.0 that it can only limit 8 parameters, but most C/C++ Compiler can limit maximum 256 parameters. Can you please verify for me? Usually, I write function that is about 100 lines. I would need 20 parameters which they are all reference to global variable inside struct. For best optimization, it does not require to create stack frame because...
4
3283
by: Oscar Monteiro | last post by:
I Have to sets of Radio buttons like so: <input type="radio" name=p1 value=1> <input type="radio" name=p1 value=2> <input type="radio" name=p1 value=3> <br> <input type="radio" name=p2 value=1> <input type="radio" name=p2 value=2> <input type="radio" name=p2 value=3> then a text area and a button:
4
1923
by: shachar | last post by:
hi all. i'm looking for a simple example of how to pass optionaly, an array to a function. if the array isn't there (it's optional) i want to know about it. thanks.
7
2306
by: Bryan Parkoff | last post by:
C/C++ Compiler encourages to limit 1,000 functions under function pointer, but I am allowed to overlimit 4,096 functions. I am just for fun to test how it works. The problem is that source code can only limit 64K lines otherwise C/C++ Compiler will fail to compile. It can't be done in static, but it can be done at run-time to save source code's space. I wrote ten sample functions. I did allocate function pointer into memory at run-time...
1
15396
by: Ike | last post by:
Recently, I began using a different MySQL verver (i.e. different machine as well as different version#, going from 4.12a to 4.1.9 max). The following query used to work: select firstname, lastname, from associates where username like 'nancianne' but now fails with: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from associates
28
4340
by: Larax | last post by:
Best explanation of my question will be an example, look below at this simple function: function SetEventHandler(element) { // some operations on element element.onclick = function(event) {
10
3151
by: Matthew Wilson | last post by:
Lately, I've been writing functions like this: def f(a, b): assert a in assert b in The point is that I'm checking the type and the values of the parameters.
0
9687
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9541
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10252
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10027
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7565
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4141
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.