Is there any possibilty to use an undefined (unlimited) amount of objects for any data type in C#?
Example: you have "Dictionary<int, Tuple<string, string>>". I want the tuple to be able to be able to hold an unlimited (dynamically adjusted) amount of objects. Is this possible with any type in C#?
How much memory does an infinite list occupy?
Theres your answer.
>>55242750
Obviously it is not about an infinite list but rather of having the possibilty to choose between 1 or for example 10 values. To be concrete: I am having an sql database and I do not know how many columns are asked for which means I have to either use an array of which most of the time 9 entries are completely empty, which is not only a really ugly way but also terribly annoying as it fucks up with multiple loops or I have to override it which bloats the code uslessly.
I mean you already have the params argument in C# so why not the other way around?
>>55242750
Well as I get no answer I will have to use an ugly way: I will add a delimiter and split the result. It is terribly ugly but appearently I have no other choice
>>55242797
Why don't you just use a SqlDataReader or some other object designed for reading result sets from a database and just get its number of columns using FieldCount? You can then store the results in a DataTable. This scenario is better handled with a solution designed specifically for database usage.
You want a list of a size that will determined at run-time? Try a list.