473,378 Members | 1,605 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,378 software developers and data experts.

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.DataTable instance.
I run this code step by step in debug mode and I have lpDataTable.Rows in
the Watch window.

The problem is that in the watch window, lpDataTable.Rows display "error:
cannot obtain value" instead of "{System.Data.DataRowCollection}".

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.Rows 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.Rows as a debug watch.
You will see lpDataTable.Rows "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*******@cimtech.ca
Nov 15 '05 #1
0 1181

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

Similar topics

9
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...
0
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...
3
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...
4
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>...
4
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
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...
1
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,...
28
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
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.
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.